Commit Graph

2297 Commits

Author SHA1 Message Date
Colin Delahunty 6272293180
[`pylint`]: bad-str-strip-call (With Autofix) (#2570) 2023-02-06 15:34:37 -05:00
Charlie Marsh f8b8b05b80
Visit deferred assignments after deferred type annotations (#2607) 2023-02-06 14:40:41 -05:00
Charlie Marsh 79776c12e2
Allow blank line before sticky-comment functions in docstrings (#2597) 2023-02-05 18:48:29 -05:00
Charlie Marsh 7fa5ce8b63
Automatically remove empty type-checking blocks (#2598) 2023-02-05 18:46:07 -05:00
Charlie Marsh f6864a96f6
Enable autofix for unnecessary-paren-on-raise-exception (#2596) 2023-02-05 18:19:27 -05:00
Charlie Marsh 291ef9856a
Remove unnecessary `super_args.rs` (#2594) 2023-02-05 18:02:09 -05:00
Charlie Marsh 87d0aa5561
Move `python` into its own `ruff_python` crate (#2593) 2023-02-05 17:53:58 -05:00
Charlie Marsh ecc9f5de99 Fix accidental setup.py changes 2023-02-05 17:18:11 -05:00
Charlie Marsh f40b974206
Add a description of project structure (#2590) 2023-02-05 17:01:09 -05:00
Micha Reiser cd8be8c0be
refactor: Introduce crates folder (#2088)
This PR introduces a new `crates` directory and moves all "product" crates into that folder. 

Part of #2059.
2023-02-05 16:47:48 -05:00
Charlie Marsh e3dfa2e04e
Implement pycodestyle's logical line detection (#1130)
Along with the logical line detection, this adds 14 of the missing `pycodestyle` rules.

For now, this is all gated behind a `logical_lines` feature that's off-by-default, which will let us implement all rules prior to shipping, since we want to couple the release of these rules with new defaults and instructions.
2023-02-05 15:06:02 -05:00
Ville Skyttä f03c8fff14
fix(commented-out-code): `mypy` and `SPDX-License-Identifier` false positives (#2587)
https://mypy.readthedocs.io/en/stable/inline_config.html#configuration-comment-format
https://spdx.github.io/spdx-spec/v2.3/using-SPDX-short-identifiers-in-source-files/#e2-format-for-spdx-license-identifier
2023-02-05 15:04:36 -05:00
Charlie Marsh 452b5a4b79
Propagate attribute-like macros in define_rule_mapping (#2583)
This enables us to feature-flag rules, like:

```rust
ruff_macros::define_rule_mapping!(
    #[cfg(feature = "logical_lines")]
    E111 => rules::pycodestyle::rules::IndentationWithInvalidMultiple,
    ...
)
```
2023-02-05 12:26:23 -05:00
Colin Delahunty 1e1dc3a7ed
[`pyupgrade`]: Removes quotes from annotations (#2431) 2023-02-05 09:43:09 -05:00
Charlie Marsh 84be1df9d5
Avoid infinite renames for unused-loop-control-variable (#2581) 2023-02-05 08:01:07 -05:00
Florian Best 6b3ae1a8e1
fix: fix syntax error in Python test COM81 (#2575) 2023-02-05 07:11:46 -05:00
Colin Delahunty 5275f6c90e
Allows UP030 to work better with *args and **kwargs (#2568) 2023-02-04 17:34:48 -05:00
Anders Kaseorg 6683ed49bc
Portably find ruff binary path from Python (#2574)
Prefer the version from a currently active virtualenv over a version
from `pip install --user`.  Add the .exe extension on Windows, and
find the path for `pip install --user` correctly on Windows.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-02-04 17:19:27 -05:00
Chris Chan ced55084db
Implement pylint's `too-many-return-statements` rule (`PLR0911`) (#2564) 2023-02-04 16:56:36 -05:00
Chris Chan f8f36a7ee0
Implement pylint's `too-many-branches` rule (`PLR0912`) (#2550) 2023-02-04 16:38:03 -05:00
Charlie Marsh 4190031618 Run cargo fmt 2023-02-04 08:36:57 -05:00
Matteo Vitali 5a9258327b
Fix python module invocation (#2563) 2023-02-04 08:23:13 -05:00
Charlie Marsh dd0145624b
Ignore direct root-children in implicit-namespace-package (#2565) 2023-02-04 08:21:24 -05:00
Charlie Marsh 7d4f0a8320 Bump Ruff version to 0.0.241 2023-02-03 19:25:12 -05:00
Charlie Marsh 4149bc7be8
Ignore direct source-children in implicit-namespace-package (#2560) 2023-02-03 19:20:27 -05:00
Pierre Sassoulas e6316b185e [pylint] Rename 'too-many-args' to 'too-many-arguments'
The actual name
2023-02-03 18:58:32 -05:00
Pierre Sassoulas a2183be96e [pylint] Rename constant-comparison to comparison-of-constant
The actual name
2023-02-03 18:58:32 -05:00
Pierre Sassoulas df39a95925 [pylint] Rename use-sys-exit to consider-using-sys-exit
The actual name
2023-02-03 18:58:32 -05:00
Charlie Marsh ff859ead85 Remove unused misplaced_comparison_constant.rs file 2023-02-03 17:10:48 -05:00
Charlie Marsh b2be30cb07
Mark fixable issues in printer output (#2500) 2023-02-03 16:26:06 -05:00
Charlie Marsh b9c1a3c5c1
Move benchmarking instructions to CONTRIBUTING.md (#2554) 2023-02-03 14:53:53 -05:00
Charlie Marsh 9751951d10
Allow F811 noqa declarations on containing import lines (#2553) 2023-02-03 14:51:06 -05:00
Charlie Marsh 64c79bde83
Mark sometimes-fixable rules as `Availability::Sometimes` (#2552) 2023-02-03 14:42:10 -05:00
Charlie Marsh da0374f360
Update RustPython to pull in lexer optimizations (#2551) 2023-02-03 14:31:53 -05:00
Charlie Marsh c26b58ba28 Hide globset logging even with --verbose 2023-02-03 13:31:04 -05:00
Charlie Marsh 56f935640a
Avoid hang when detecting trailing comments (#2549) 2023-02-03 13:05:55 -05:00
Charlie Marsh 85ca6cde49
Fix a few nursery rule violations (#2548) 2023-02-03 11:59:29 -05:00
Aarni Koskela 38addbe50d
Soft-deprecate update_check (#2530) 2023-02-03 11:33:38 -05:00
Charlie Marsh 924e35b1c3
Add `print_stdout` and `print_stderr` to Clippy enforcement (#2542) 2023-02-03 11:13:44 -05:00
Charlie Marsh d05ea4dbac
Exit upon showing files with `--show-files` (#2543) 2023-02-03 09:41:09 -05:00
Charlie Marsh b5ac93d2ee
Move Clippy configuration to config.toml (#2541) 2023-02-03 09:26:36 -05:00
Aarni Koskela 924e264156
Move flake8-{errmsg,print} violations (#2536) 2023-02-03 09:03:49 -05:00
Aarni Koskela 14c5000ad5
Move McCabe violations (#2534) 2023-02-03 08:41:11 -05:00
Aarni Koskela d985473f4f
Move pygrep-hooks violations (#2539) 2023-02-03 08:41:05 -05:00
Aarni Koskela 47e0b2521a
Move flake8-2020 violations (#2537) 2023-02-03 08:40:56 -05:00
Aarni Koskela a319980a7c
Move pep8-naming violations (#2538) 2023-02-03 08:40:48 -05:00
Aarni Koskela 3336dd63f4
Move flake8-implicit-str-concat violations (#2535) 2023-02-03 08:24:06 -05:00
Aarni Koskela ae20a721a1
Don't walk past project root when figuring out exclusion (#2471) 2023-02-03 08:23:51 -05:00
Aarni Koskela a26b1f43e9
Move flake8-unused-arguments violations (#2533) 2023-02-03 08:19:18 -05:00
Chris Chan 139a6d8331
Minor fixes to PLR0915 logic (#2518) 2023-02-03 08:10:59 -05:00