ruff/crates
Matthew Spero f80528fbf2
Make ARG002 compatible with EM101 when raising NotImplementedError (#13714)
## Summary

This pull request resolves some rule thrashing identified in #12427 by
allowing for unused arguments when using `NotImplementedError` with a
variable per [this
comment](https://github.com/astral-sh/ruff/issues/12427#issuecomment-2384727468).

**Note**

This feels a little heavy-handed / edge-case-prone. So, to be clear, I'm
happy to scrap this code and just update the docs to communicate that
`abstractmethod` and friends should be used in this scenario (or
similar). Just let me know what you'd like done!

fixes: #12427 

## Test Plan

I added a test-case to the existing `ARG.py` file and ran...

```sh
cargo run -p ruff -- check crates/ruff_linter/resources/test/fixtures/flake8_unused_arguments/ARG.py --no-cache --preview --select ARG002
```

---------

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2024-10-18 06:44:22 +00:00
..
red_knot Upgrade salsa (#13757) 2024-10-15 11:06:32 +00:00
red_knot_python_semantic [red-knot] Use the right scope when considering class bases (#13766) 2024-10-17 22:29:46 +00:00
red_knot_server Use backticks for code in red-knot messages (#13599) 2024-10-02 03:14:28 +00:00
red_knot_test [red-knot] Port type inference tests to new test framework (#13719) 2024-10-15 11:23:46 -07:00
red_knot_vendored Sync vendored typeshed stubs (#13753) 2024-10-15 13:36:11 +00:00
red_knot_wasm Use backticks for code in red-knot messages (#13599) 2024-10-02 03:14:28 +00:00
red_knot_workspace [red-knot] Infer target types for unpacked tuple assignment (#13316) 2024-10-15 19:07:11 +00:00
ruff Changelog for Ruff v0.7 (#13794) 2024-10-17 16:14:21 +00:00
ruff_benchmark [red-knot] Add control flow for try/except blocks (#13729) 2024-10-16 13:03:59 +00:00
ruff_cache Fix cache key collisions for paths with separators (#12159) 2024-07-03 07:36:46 -05:00
ruff_db Use backticks for code in red-knot messages (#13599) 2024-10-02 03:14:28 +00:00
ruff_dev Harmonise methods for distinguishing different Python source types (#13682) 2024-10-09 13:18:52 +00:00
ruff_diagnostics [Minor typo] Fix article in "an fix" (#12797) 2024-08-10 21:22:00 -04:00
ruff_formatter Use backticks for code in red-knot messages (#13599) 2024-10-02 03:14:28 +00:00
ruff_graph Upgrade salsa (#13757) 2024-10-15 11:06:32 +00:00
ruff_index [red-knot] small efficiency improvements and bugfixes to use-def map building (#12373) 2024-07-18 09:24:58 -07:00
ruff_linter Make ARG002 compatible with EM101 when raising NotImplementedError (#13714) 2024-10-18 06:44:22 +00:00
ruff_macros Drop deprecated nursery rule group (#10172) 2024-06-27 13:44:11 +02:00
ruff_notebook Allow ipytest cell magic (#13745) 2024-10-14 15:48:33 +05:30
ruff_python_ast Refactor: Remove StringPart and AnyStringPart in favor of StringLikePart (#13772) 2024-10-16 12:52:06 +02:00
ruff_python_ast_integration_tests [internal] ComparableExpr (f)strings and bytes made invariant under concatenation (#13301) 2024-09-25 16:58:57 +02:00
ruff_python_codegen Implement iter(), len() and is_empty() for all display-literal AST nodes (#12807) 2024-08-12 10:39:28 +00:00
ruff_python_formatter Enable preview mode for 'unstable' black tests (#13776) 2024-10-16 12:25:34 +00:00
ruff_python_index Enable token-based rules on source with syntax errors (#11950) 2024-07-02 08:57:46 +00:00
ruff_python_literal Remove some unused pub functions (#11576) 2024-05-28 09:56:51 -04:00
ruff_python_parser Expose internal types as public access (#13509) 2024-09-26 17:34:30 +02:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Harmonise methods for distinguishing different Python source types (#13682) 2024-10-09 13:18:52 +00:00
ruff_python_stdlib Harmonise methods for distinguishing different Python source types (#13682) 2024-10-09 13:18:52 +00:00
ruff_python_trivia [red-knot] type inference/checking test framework (#13636) 2024-10-08 12:33:19 -07:00
ruff_python_trivia_integration_tests Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
ruff_server Avoid indexing the workspace for single-file mode (#13770) 2024-10-18 10:51:43 +05:30
ruff_source_file Fix off-by one error in the LineIndex::offset calculation (#13407) 2024-09-19 11:58:45 +00:00
ruff_text_size [red-knot] type inference/checking test framework (#13636) 2024-10-08 12:33:19 -07:00
ruff_wasm Changelog for Ruff v0.7 (#13794) 2024-10-17 16:14:21 +00:00
ruff_workspace Remove allow-unused-imports setting from the common lint options (#13677) 2024-10-17 16:35:12 +01:00