Commit Graph

1258 Commits

Author SHA1 Message Date
Charlie Marsh 1c3265ef98 Bump version to 0.0.231 2023-01-23 12:51:09 -05:00
Maksudul Haque 8001a1639c
[`flake8-bandit`] Added Rule `S612` (Use of insecure `logging.config.listen`) (#2108)
ref: https://github.com/charliermarsh/ruff/issues/1646
2023-01-23 12:37:33 -05:00
Charlie Marsh 7d9c1d7a5a Add a note on some isort incompatibilities 2023-01-23 12:32:35 -05:00
Thomas MK c5cebb106e
Fix outdated description of ruff's support of isort settings (#2106)
Ruff supports more than `known-first-party`, `known-third-party`, `extra-standard-library`, and `src` nowadays.

Not sure if this is the best wording. Suggestions welcome!
2023-01-23 12:29:44 -05:00
Simon Brugman f472fbc6d4
docs(readme): add pypa cibuildwheel (#2107) 2023-01-23 11:39:23 -05:00
Steve Dignam 0c624af036
Add flake8-pie PIE800: no-unnecessary-spread (#1881)
Checks for unnecessary spreads, like `{**foo, **{"bar": True}}`
rel: https://github.com/charliermarsh/ruff/issues/1879
rel: https://github.com/charliermarsh/ruff/issues/1543
2023-01-22 21:43:34 -05:00
Steve Dignam 4ca328f964
Add flake8-pie PIE804: no-unnecessary-dict-kwargs (#1884)
Warn about things like `foo(**{"bar": True})` which is equivalent to `foo(bar=True)`

rel: https://github.com/charliermarsh/ruff/issues/1879
rel: https://github.com/charliermarsh/ruff/issues/1543
2023-01-22 21:32:45 -05:00
Charlie Marsh f40ae943a7 Fix bad documentation message for init option 2023-01-22 19:25:23 -05:00
alm 4fb0c6e3ad
feat: Implement TRY201 (#2073) 2023-01-22 17:08:57 -05:00
Simon Brugman 11f06055a0
feat: flake8-use-pathlib PTH100-124 (#2090) 2023-01-22 15:17:25 -05:00
Charlie Marsh 23b622943e Bump version to 0.0.230 2023-01-22 13:58:41 -05:00
alm e11cf1bf65
Update linters PyPI links to latest version (#2062) 2023-01-22 13:10:22 -05:00
Martin Fischer 4758ee6ac4 refactor: Generate Linter -> RuleSelector mapping via macro
To enable ruff_dev to automatically generate the rule Markdown tables in
the README the ruff library contained the following function:

    Linter::codes() -> Vec<RuleSelector>

which was slightly changed to `fn prefixes(&self) -> Prefixes` in
9dc66b5a65 to enable ruff_dev to split
up the Markdown tables for linters that have multiple prefixes
(pycodestyle has E & W, Pylint has PLC, PLE, PLR & PLW).

The definition of this method was however largely redundant with the
#[prefix] macro attributes in the Linter enum, which are used to
derive the Linter::parse_code function, used by the --explain command.

This commit removes the redundant Linter::prefixes by introducing a
same-named method with a different signature to the RuleNamespace trait:

     fn prefixes(&self) -> &'static [&'static str];

As well as implementing IntoIterator<Rule> for &Linter. We extend the
extisting RuleNamespace proc macro to automatically derive both
implementations from the Linter enum definition.

To support the previously mentioned Markdown table splitting we
introduce a very simple hand-written method to the Linter impl:

    fn categories(&self) -> Option<&'static [LinterCategory]>;
2023-01-22 11:51:29 -05:00
Simon Brugman 6fc6bf0648
feat: enable autofix for TRY004 (#2084)
functionality was already implemented, just the trait needed to be added
2023-01-22 07:18:56 -05:00
Cosmo 39aed6f11d
Update link to Pylint parity tracking issue (#2074) 2023-01-21 17:46:55 -05:00
Simon Brugman 67de8ac85e
feat: implementation for TRY004 (#2066)
See: #2056.
2023-01-21 14:58:59 -05:00
Charlie Marsh 84300e00ff Bump version to 0.0.229 2023-01-21 13:18:06 -05:00
Simon Brugman afcf5c0ee0
feat: plugin scaffold for tryceratops with TRY300 (#2055)
Renamed to TRY to avoid conflicts, as proposed in https://github.com/guilatrova/tryceratops/pull/55

https://github.com/guilatrova/tryceratops/blob/main/docs/violations/TC300.md

See: #2056
2023-01-21 11:25:10 -05:00
Colin Delahunty 80295f335b
Pyupgrade: Printf string formatting (#1803) 2023-01-21 09:37:22 -05:00
Charlie Marsh 8e558a3458
Add scaffolding for `flake8-type-checking` extension (#2048)
This PR adds the scaffolding files for `flake8-type-checking`, along with the simplest rule (`empty-type-checking-block`), just as an example to get us started.

See: #1785.
2023-01-20 22:41:36 -05:00
Martin Fischer b19258a243 refactor: Rename RuleCodePrefix to RuleSelector
More accurate since the enum also encompasses:

* ALL (which isn't a prefix at all)

* fully-qualified rule codes (which aren't prefixes unless you say
  they're a prefix to the empty string but that's not intuitive)
2023-01-20 20:25:57 -05:00
Simon Brugman 608b2191aa
[`flake8-executable`] EXE003-005 (#2023)
Tracking issue: https://github.com/charliermarsh/ruff/issues/2024

Implementation for EXE003, EXE004 and EXE005 of `flake8-executable` 
(shebang should contain "python", not have whitespace before, and should be on the first line)

Please take in mind that this is my first rust contribution.

The remaining EXE-rules are a combination of shebang (`lines.rs`), file permissions (`fs.rs`) and if-conditions (`ast.rs`). I was not able to find other rules that have interactions/dependencies in them. Any advice on how this can be best implemented would be very welcome.

For autofixing `EXE005`, I had in mind to _move_  the shebang line to the top op the file. This could be achieved by a combination of `Fix::insert` and `Fix::delete` (multiple fixes per diagnostic), or by implementing a dedicated `Fix::move`, or perhaps in other ways. For now I've left it out, but keen on hearing what you think would be most consistent with the package, and pointer where to start (if at all).

---
If you care about another testimonial:
`ruff` not only helps staying on top of the many excellent flake8 plugins and other Python code quality tools that are available, it also applies them at baffling speed.
(Planning to implement it soon for github.com/pandas-profiling/pandas-profiling (as largest contributor) and github.com/ing-bank/popmon.)
2023-01-20 18:19:07 -05:00
Eric Roberts 3939c2dbf7
Add support for pycodestyle E101 (#2038)
Rule described here: https://www.flake8rules.com/rules/E101.html

I tried to follow contributing guidelines closely, I've never worked with Rust before. Stumbled across Ruff a few days ago and would like to use it in our project, but we use a bunch of flake8 rules that are not yet implemented in ruff, so I decided to give it a go.
2023-01-20 17:24:58 -05:00
Hugo van Kemenade a0e3347e43
README: `--force-exclude` is already set (#2042)
Re: https://github.com/charliermarsh/ruff-pre-commit/issues/19 / https://github.com/charliermarsh/ruff-pre-commit/pull/20

This is now always set, no need to include it in the README example.
2023-01-20 17:20:22 -05:00
Charlie Marsh 5377d24507 Bump version to 0.0.228 2023-01-20 09:58:56 -05:00
Aarni Koskela bd2de5624e
Move readme dev details to CONTRIBUTING.md and fix contradictions (#2030)
Following up on #2018/#2019 discussion, this moves the readme's development-related bits to `CONTRIBUTING.md` to avoid duplication, and fixes up the commands accordingly 😄
2023-01-20 09:23:28 -05:00
Ville Skyttä 6072edf5bf
Note `.astimezone()` in call-datetime-strptime-without-zone message (#2015) 2023-01-20 07:40:34 -05:00
Martin Fischer 4061eeeb32 Update CI to use MSRV for cargo test and build
As per Cargo.toml our minimal supported Rust version is 1.65.0, so we
should be using that version in our CI for cargo test and cargo build.

This was apparently accidentally changed in
79ca66ace5.
2023-01-20 07:39:40 -05:00
Aarni Koskela bea6deb0c3
Port pydocstyle code 401 (ImperativeMood) (#1999)
This adds support for pydocstyle code D401 using the `imperative` crate.
2023-01-20 07:18:27 -05:00
Colin Delahunty 81db00a3c4
Pyupgrade: Extraneous parenthesis (#1926) 2023-01-20 00:04:07 -05:00
Charlie Marsh cf56955ba6 Bump version to 0.0.227 2023-01-19 23:24:52 -05:00
Martin Fischer c600991905 Change AsRef<str> impl for Rule to kebab-case
As we surface rule names more to users we want
them to be easier to type than PascalCase.

Prior art:

Pylint and ESLint also use kebab-case for their rule names.
Clippy uses snake_case but only for syntactical reasons
(so that the argument to e.g. #![allow(clippy::some_lint)]
can be parsed as a path[1]).

[1]: https://doc.rust-lang.org/reference/paths.html
2023-01-19 21:37:11 -05:00
Charlie Marsh f6a93a4c3d
Enable autofix for `FitsOnOneLine` (`D200`) (#2006)
Closes #1965.
2023-01-19 19:24:50 -05:00
Aarni Koskela de54ff114e
Add RUF005 "unpack instead of concatenating" check (#1957)
This PR adds a new check that turns expressions such as `[1, 2, 3] + foo` into `[1, 2, 3, *foo]`, since the latter is easier to read and faster:

```
~ $ python3.11 -m timeit -s 'b = [6, 5, 4]' '[1, 2, 3] + b'
5000000 loops, best of 5: 81.4 nsec per loop
~ $ python3.11 -m timeit -s 'b = [6, 5, 4]' '[1, 2, 3, *b]'
5000000 loops, best of 5: 66.2 nsec per loop
```

However there's a couple of gotchas:

* This felt like a `simplify` rule, so I borrowed an unused `SIM` code even if the upstream `flake8-simplify` doesn't do this transform. If it should be assigned some other code, let me know 😄 
* **More importantly** this transform could be unsafe if the other operand of the `+` operation has overridden `__add__` to do something else. What's the `ruff` policy around potentially unsafe operations? (I think some of the suggestions other ported rules give could be semantically different from the original code, but I'm not sure.)
* I'm not a very established Rustacean, so there's no doubt my code isn't quite idiomatic. (For instance, is there a neater way to write that four-way `match` statement?)

Thanks for `ruff`, by the way! :)
2023-01-19 17:38:17 -05:00
Martin Fischer 3c3da8a88c derive-msg-formats 5/5: Remove placeholder implementations
# This commit has been generated via the following Python script:
# (followed by `cargo +nightly fmt` and `cargo dev generate-all`)
# For the reasoning see the previous commit(s).

import re
import sys

for path in (
    'src/violations.rs',
    'src/rules/flake8_tidy_imports/banned_api.rs',
    'src/rules/flake8_tidy_imports/relative_imports.rs',
):
    with open(path) as f:
        text = ''

        while line := next(f, None):

            if line.strip() != 'fn message(&self) -> String {':
                text += line
                continue

            text += '    #[derive_message_formats]\n' + line

            body = next(f)
            while (line := next(f)) != '    }\n':
                body += line

            # body = re.sub(r'(?<!code\| |\.push\()format!', 'format!', body)
            body = re.sub(
                r'("[^"]+")\s*\.to_string\(\)', r'format!(\1)', body, re.DOTALL
            )
            body = re.sub(
                r'(r#".+?"#)\s*\.to_string\(\)', r'format!(\1)', body, re.DOTALL
            )

            text += body + '    }\n'

            while (line := next(f)).strip() != 'fn placeholder() -> Self {':
                text += line
            while (line := next(f)) != '    }\n':
                pass

    with open(path, 'w') as f:
        f.write(text)
2023-01-19 11:03:32 -05:00
Charlie Marsh a122d95ef5
Preserve unmatched comparators in `SIM109` (#1998)
Closes #1993.
2023-01-19 10:23:20 -05:00
Damien Allen 6ddfe50ac4
Added pylint formatter (#1995)
Fixes: #1953

@charliermarsh thank you for the tips in the issue.

I'm not very familiar with Rust, so please excuse if my string formatting syntax is messy.

In terms of testing, I compared output of `flake8 --format=pylint ` and `cargo run --format=pylint` on the same code and the output syntax seems to check out.
2023-01-19 08:01:27 -05:00
Charlie Marsh d8645acd1f Bump version to 0.0.226 2023-01-18 20:54:38 -05:00
Charlie Marsh d33424ec9d
Enable suppression of magic values by type (#1987)
Closes #1949.
2023-01-18 20:44:24 -05:00
Charlie Marsh 969a6f0d53
Replace misplaced-comparison-constant with SIM300 (#1980)
Closes: #1954.
2023-01-18 18:42:49 -05:00
Charlie Marsh 7628876ff2
Invert order of yoda-conditions message (#1979)
The suggestion was wrong!
2023-01-18 18:27:36 -05:00
Anders Kaseorg 1e803f7108
README: Link “Flake8” for consistency with the rest of the list (#1969)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-01-18 13:07:21 -05:00
Maksudul Haque 9a3e525930
[`isort`] Add `no-lines-before` Option (#1955)
Closes https://github.com/charliermarsh/ruff/issues/1916.
2023-01-18 11:09:47 -05:00
Anders Kaseorg b9c6cfc0ab
Autofix SIM117 (MultipleWithStatements) (#1961)
This is slightly buggy due to Instagram/LibCST#855; it will complain `[ERROR] Failed to fix nested with: Failed to extract CST from source` when trying to fix nested parenthesized `with` statements lacking trailing commas. But presumably people who write parenthesized `with` statements already knew that they don’t need to nest them.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-01-18 11:06:04 -05:00
Anders Kaseorg 83346de6e0 Autofix SIM102 (NestedIfStatements)
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-01-18 07:37:27 -05:00
skykasko 6c7e60b4f9
Fix bad link for flake8-no-pep420 (#1952)
See https://github.com/charliermarsh/ruff/pull/1942.
2023-01-18 07:36:05 -05:00
Maksudul Haque 868d0b3e29
[`isort`] Add `constants` and `variables` Options (#1951)
closes https://github.com/charliermarsh/ruff/issues/1819
2023-01-18 07:30:51 -05:00
Charlie Marsh cdb4700813 Bump version to 0.0.225 2023-01-18 00:22:48 -05:00
Edgar R. M c880d744fd
Implement `flake8-no-pep420` (#1942)
Closes https://github.com/charliermarsh/ruff/issues/1844.
2023-01-17 22:10:32 -05:00
Charlie Marsh 072849a8a9
Move `@functools.cache` rewrites to their own rule (#1938)
Closes #1934.
2023-01-17 15:12:40 -05:00
Martin Fischer f4da7635f0 Add missing url for flake8-import-conventions 2023-01-17 07:44:40 -05:00
Charlie Marsh 74a8a218f3 Bump version to 0.0.224 2023-01-16 23:43:14 -05:00
Colin Delahunty 1730f2a603
[pyupgrade] Automatically rewrite format-strings to f-strings (#1905) 2023-01-16 23:06:39 -05:00
Leonardo Esparis 6e88c60c46
Add flake8-pie PIE796: prefer-unique-enum (#1923)
I accept any suggestion. By the way, I have a doubt, I have checked and all flake8-pie plugins can be fixed by ruff, but is it necessary that this one is also fixed automatically ?

rel #1543
2023-01-16 19:27:34 -05:00
Charlie Marsh 2ed1f78873
Add benchmark scripts for no-IO (#1925) 2023-01-16 17:38:40 -05:00
Charlie Marsh 3b4aaa53c1
Add some new testimonials (#1921) 2023-01-16 14:44:52 -05:00
Martin Fischer 5bf6da0db7 refactor: Rename BannedRelativeImport to RelativeImports
The idea is to follow the Rust naming convention for lints[1]:

> the lint name should make sense when read as
> "allow lint-name" or "allow lint-name items"

Following that convention prefixing "Banned" is
redundant as it could be prefixed to any lint name.

[1]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
2023-01-16 11:27:24 -05:00
Harutaka Kawamura 2236b4bd59
Add backticks to B904's message (#1914)
This PR adds backticks to B904's message to improve readability.


Without backticks:

<img width="1480" alt="image" src="https://user-images.githubusercontent.com/17039389/212682457-71f13de9-e3dd-4ead-a82b-98e5b60653c2.png">

With backticks:

<img width="1480" alt="image" src="https://user-images.githubusercontent.com/17039389/212682775-36868401-b63e-47d1-ae25-b43b61866b6c.png">
2023-01-16 11:12:43 -05:00
Charlie Marsh fbf311f7d5 Add instructions for Pyupgrade benchmark 2023-01-16 03:21:31 -05:00
Charlie Marsh 42031b8574
Re-run benchmark and update documentation (#1907)
Closes #269.
2023-01-16 01:38:58 -05:00
Charlie Marsh e8577d5e26 Bump version to 0.0.223 2023-01-15 22:44:01 -05:00
Charlie Marsh bcb1e6ba20 Add flake8-commas to the README 2023-01-15 22:43:29 -05:00
Ran Benita d3041587ad
Implement flake8-commas (#1872)
Implements [flake8-commas](https://github.com/PyCQA/flake8-commas). Fixes #1058.

The plugin is mostly redundant with Black (and also deprecated upstream), but very useful for projects which can't/won't use an auto-formatter. 

This linter works on tokens. Before porting to Rust, I cleaned up the Python code ([link](https://gist.github.com/bluetech/7c5dcbdec4a73dd5a74d4bc09c72b8b9)) and made sure the tests pass. In the Rust version I tried to add explanatory comments, to the best of my understanding of the original logic.

Some changes I did make:

- Got rid of rule C814 - "missing trailing comma in Python 2". Ruff doesn't support Python 2.
- Merged rules C815 - "missing trailing comma in Python 3.5+" and C816 - "missing trailing comma in Python 3.6+" into C812 - "missing trailing comma". These Python versions are outdated, didn't think it was worth the complication.
- Added autofixes for C812 and C819.

Autofix is missing for C818 - "trailing comma on bare tuple prohibited". It needs to turn e.g. `x = 1,` into `x = (1, )`, it's a bit difficult to do with tokens only, so I skipped it for now.

I ran the rules on cpython/Lib and on a big internal code base and it works as intended (though I only sampled the diffs).
2023-01-15 14:03:32 -05:00
Tom Fryers 85bdb45eca
Improve magic value message wording (#1892)
The message previously specified 'number', but the error applies to more types.
2023-01-15 12:53:02 -05:00
Charlie Marsh e3cc918b93 Bump version to 0.0.222 2023-01-14 23:34:53 -05:00
Charlie Marsh a01edad1c4
Remove --max-complexity from the CLI (#1877) 2023-01-14 18:27:23 -05:00
Charlie Marsh 812df77246 Add Dagster and SnowCLI 2023-01-14 10:45:16 -05:00
Thomas MK 9dc66b5a65
Split up the table corresponding to the pylint rules (#1868)
This makes it easier to see which rules you're enabling when selecting
one of the pylint codes (like `PLC`). This also makes it clearer what
those abbreviations stand for. When I first saw the pylint section, I
was very confused by that, so other might be as well.

See it rendered here:
https://github.com/thomkeh/ruff/blob/patch-1/README.md#pylint-plc-ple-plr-plw
2023-01-14 08:07:02 -05:00
Charlie Marsh 027382f891
Add support for namespace packages (#1859)
Closes #1817.
2023-01-14 07:31:57 -05:00
Charlie Marsh 931d41bff1 Revert "Bump version to 0.0.222"
This reverts commit 852aab5758.
2023-01-13 23:56:29 -05:00
Charlie Marsh 852aab5758 Bump version to 0.0.222 2023-01-13 23:50:08 -05:00
Charlie Marsh ee6c81d02a Bump version to 0.0.221 2023-01-13 23:33:15 -05:00
Charlie Marsh 22341c4ae4 Move repology down 2023-01-13 22:29:26 -05:00
Colin Delahunty e4993bd7e2
Added ALE (#1857)
Fixes the sub issue I brought up in #1829.
2023-01-13 21:39:51 -05:00
max0x53 fc3f722df5
Implement `PLR0133` (`ComparisonOfConstants`) (#1841)
This PR adds [Pylint
`R0133`](https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/comparison-of-constants.html)

Feel free to suggest changes and additions, I have tried to maintain
parity with the Pylint implementation
[`comparison_checker.py`](https://github.com/PyCQA/pylint/blob/main/pylint/checkers/base/comparison_checker.py#L247)

See #970
2023-01-13 12:14:35 -05:00
Maksudul Haque 84ef7a0171
[`isort`] Add `classes` Config Option (#1849)
ref https://github.com/charliermarsh/ruff/issues/1819
2023-01-13 12:13:01 -05:00
Nicola Soranzo 66b1d09362
Clarify that some flake8-bugbear opinionated rules are already implemented (#1847)
E.g. B904 and B905.
2023-01-13 11:49:05 -05:00
max0x53 b47e8e6770
Implement `PLR2004` (`MagicValueComparison`) (#1828)
This PR adds [Pylint
`R2004`](https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/magic-value-comparison.html#magic-value-comparison-r2004)

Feel free to suggest changes and additions, I have tried to maintain
parity with the Pylint implementation
[`magic_value.py`](https://github.com/PyCQA/pylint/blob/main/pylint/extensions/magic_value.py)

See #970
2023-01-12 19:44:18 -05:00
Jan Katins ef17c82998
Document the way extend-ignore/select are applied (#1839)
Closes: https://github.com/charliermarsh/ruff/issues/1838
2023-01-12 19:44:03 -05:00
Charlie Marsh 9aeb5df5fe Bump version to 0.0.220 2023-01-12 17:57:04 -05:00
Ash Berlin-Taylor bf5c048502
Airflow is now using ruff (#1833)
😀
2023-01-12 16:50:01 -05:00
Charlie Marsh 3110d342c7
Implement isort's `reverse_relative` setting (#1826)
This PR implements `reverse-relative`, from isort, but renames it to
`relative-imports-order` with the respected value `closest-to-furthest`
and `furthest-to-closest`, and the latter being the default.

Closes #1813.
2023-01-12 15:48:40 -05:00
nefrob 39aae28eb4
📝 Update readme example for adding isort required imports (#1824)
Fixes use of  isort name to the ruff name.
2023-01-12 13:18:06 -05:00
messense c6320b29e4
Implement autofix for flake8-quotes (#1810)
Resolves #1789
2023-01-12 12:42:28 -05:00
Maksudul Haque 1a90408e8c
[`flake8-bandit`] Add Rule for `S701` (jinja2 autoescape false) (#1815)
ref: https://github.com/charliermarsh/ruff/issues/1646

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-12 11:59:20 -05:00
Jeroen Van Goey 07134c50c8
Add usage of ruff in pandas to README (#1811)
pandas now uses ruff for linting, see
https://github.com/pandas-dev/pandas/pull/50160
2023-01-12 10:55:21 -05:00
Charlie Marsh d8162ce79d Bump version to 0.0.219 2023-01-11 23:46:01 -05:00
Charlie Marsh e11ef54bda
Improve globset documentation and help message (#1808)
Closes #1545.
2023-01-11 23:41:56 -05:00
Charlie Marsh f450e2e79d
Implement doc line length enforcement (#1804)
This PR implements `W505` (`DocLineTooLong`), which is similar to `E501`
(`LineTooLong`) but confined to doc lines.

I based the "doc line" definition on pycodestyle, which defines a doc
line as a standalone comment or string statement. Our definition is a
bit more liberal, since we consider any string statement a doc line
(even if it's part of a multi-line statement) -- but that seems fine to
me.

Note that, unusually, this rule requires custom extraction from both the
token stream (to find standalone comments) and the AST (to find string
statements).

Closes #1784.
2023-01-11 22:32:14 -05:00
Chammika Mannakkara 4523885268
flake8_simplify : SIM401 (#1778)
Ref #998 

- Implements SIM401 with fix
- Added tests

Notes: 
- only recognize simple ExprKind::Name variables in expr patterns for
now
- bug-fix from reference implementation: check 3-conditions (dict-key,
target-variable, dict-name) to be equal, `flake8_simplify` only test
first two (only first in second pattern)
2023-01-11 19:51:37 -05:00
Maksudul Haque de81b0cd38
[`flake8-simplify`] Add Rule for `SIM115` (Use context handler for opening files) (#1782)
ref: https://github.com/charliermarsh/ruff/issues/998

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-11 19:28:05 -05:00
Grzegorz Bokota fb2382fbc3
Update readme to reflect #1763 (#1780)
When checking changes in the 0.0.218 release I noticed that auto fixing
PT004 and PT005 was disabled but this change was not reflected in
README. So I create this small PR to do this.

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-11 18:37:41 -05:00
Charlie Marsh a3fcc3b28d
Disable update check by default (#1786)
This has received enough criticism that I'm comfortable making it
opt-in.
2023-01-11 13:47:40 -05:00
Charlie Marsh cfbd068dd5 Bump version to 0.0.218 2023-01-10 21:28:23 -05:00
Colin Delahunty c016c41c71
Pyupgrade: Format specifiers (#1594)
A part of #827. Posting this for visibility. Still has some work to do
to be done.

Things that still need done before this is ready:

- [x] Does not work when the item is being assigned to a variable
- [x] Does not work if being used in a function call
- [x] Fix incorrectly removed calls in the function
- [x] Has not been tested with pyupgrade negative test cases

Tests from pyupgrade can be seen here:
https://github.com/asottile/pyupgrade/blob/main/tests/features/format_literals_test.py

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-10 20:21:04 -05:00
Charlie Marsh f1a5e53f06
Enable isort-style `required-imports` enforcement (#1762)
In isort, this is called `add-imports`, but I prefer the declarative
name.

The idea is that by adding the following to your `pyproject.toml`, you
can ensure that the import is included in all files:

```toml
[tool.ruff.isort]
required-imports = ["from __future__ import annotations"]
```

I mostly reverse-engineered isort's logic for making decisions, though I
made some slight tweaks that I think are preferable. A few comments:

- Like isort, we don't enforce this on empty files (like empty
`__init__.py`).
- Like isort, we require that the import is at the top-level.
- isort will skip any docstrings, and any comments on the first three
lines (I think, based on testing). Ruff places the import after the last
docstring or comment in the file preamble (that is: after the last
docstring or comment that comes before the _first_ non-docstring and
non-comment).

Resolves #1700.
2023-01-10 18:12:57 -05:00
Maksudul Haque b8e3f0bc13
[`flake8-bandit`] Add Rule for `S508` (snmp insecure version) & `S509` (snmp weak cryptography) (#1771)
ref: https://github.com/charliermarsh/ruff/issues/1646

Co-authored-by: messense <messense@icloud.com>
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-10 13:13:54 -05:00
Charlie Marsh 643cedb200
Move CONTRIBUTING.md to top-level (#1768) 2023-01-10 07:38:12 -05:00
messense 9384a081f9
Implement flake8-simplify SIM112 (#1764)
Ref #998
2023-01-10 07:24:01 -05:00
Charlie Marsh edab268d50 Bump version to 0.0.217 2023-01-09 23:26:22 -05:00
Charlie Marsh e4fad70a57
Update documentation to match latest terminology (#1760)
Closes #1759.
2023-01-09 21:10:47 -05:00
Charlie Marsh 9532f342a6
Enable project-specific typing module re-exports (#1754)
Resolves #1744.
2023-01-09 18:17:50 -05:00
Charlie Marsh 2729f3d207
Add support for defining extra builtins (#1747)
Resolves #1745.
2023-01-09 12:24:28 -05:00
Charlie Marsh 59155ce9f6
Rename `checks` and `plugins` to `rules` (#1739) 2023-01-09 01:39:51 -05:00
Charlie Marsh caf6c65de7 Bump version to 0.0.216 2023-01-09 01:14:28 -05:00
Matt Oberle 147d594b38
Add isort.force-sort-within-sections setting (#1635)
This commit is a first attempt at addressing issue #1003.

The default `isort` behavior is `force-sort-within-sections = false`,
which places `from X import Y` statements after `import X` statements.

When `force-sort-within-sections = true` all imports are sorted by
module name.

When module names are equivalent, the `import` statement comes before
the `from` statement.
2023-01-09 01:06:48 -05:00
Harutaka Kawamura fe4eb13601
Autofix PT004, PT005, PT024, and PT025 (#1740) 2023-01-08 22:41:00 -05:00
Charlie Marsh 09dc3c7225
Rename `Check` to `Diagnostic` (#1725)
Along with:

- `CheckKind` -> `DiagnosticKind`
- `CheckCode` -> `RuleCode`
- `CheckCodePrefix` -> `RuleCodePrefix`
2023-01-08 17:46:20 -05:00
Charlie Marsh 0152814a00 Bump version to 0.0.215 2023-01-07 22:17:29 -05:00
Charlie Marsh 8b01b53d89
Move RUFF_CACHE_DIR to Clap's env support (#1733) 2023-01-07 22:01:20 -05:00
messense f9a5867d3e
Add `RUFF_FORMAT` environment variable support (#1731)
Resolves #1716
2023-01-07 21:54:19 -05:00
Charlie Marsh 7d24146df7
Implement `--isolated` CLI flag (#1727)
Closes #1724.
2023-01-07 18:43:58 -05:00
Charlie Marsh 4de6c26ff9
Automatically remove duplicate dictionary keys (#1710)
For now, to be safe, we're only removing keys with duplicate _values_.

See: #1647.
2023-01-07 16:16:42 -05:00
Charlie Marsh edf46c06d0 Bump version to 0.0.214 2023-01-07 15:34:45 -05:00
Chammika Mannakkara 9cfce61f36
flake8_simplify : SIM210, SIM211, SIM212 (#1717) 2023-01-07 15:32:34 -05:00
Harutaka Kawamura 07f72990a9
Implement autofix for PT009 (#1713) 2023-01-07 12:28:25 -05:00
messense 402feffe85
Implement flake8-simplify SIM103 (#1712)
Ref #998

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-07 07:33:24 -05:00
Charlie Marsh f1c3ebfe0f Bump version to 0.0.213 2023-01-07 00:30:56 -05:00
Harutaka Kawamura 8c836aeecf
Add more backticks to flake8-pytest-style error messages (#1707) 2023-01-06 22:55:24 -05:00
Charlie Marsh 0527fb9335
Automatically remove unused variables (#1683)
Closes #1460.
2023-01-06 22:06:04 -05:00
Charlie Marsh 12d2526edb
Require explicit opt-in for GitHub and Gitlab formats (#1697) 2023-01-06 15:57:56 -05:00
Maksudul Haque 9409b49ea2
[`flake8-bandit`] Add Rule for `S501` (request call with `verify=False`) (#1695)
ref: https://github.com/charliermarsh/ruff/issues/1646
2023-01-06 11:44:19 -05:00
Chammika Mannakkara 1392170dbf
Simplify SIM201, SIM202, SIM208 (#1666)
Flake8 simplify #998 

SIM201, SIM202 and SIM208 is done here with fixes.

Note: SIM203 == E713 

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-06 10:47:48 -05:00
messense 0a940b3cb4
Implement flake8-simplify SIM109 (#1687)
Ref #998

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-06 10:29:49 -05:00
Maksudul Haque 6aba43a9b0
[`flake8-bandit`] Add Rule for `S113` (requests call without timeout) (#1692)
ref: https://github.com/charliermarsh/ruff/issues/1646

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-06 10:26:08 -05:00
messense 76a9dc61f0
Implement flake8-simplify SIM108 (#1684)
Ref #998

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-06 08:28:51 -05:00
Maksudul Haque 16d7e13c72
Update `CONTRIBUTING.md` location on `README.md` (#1688) 2023-01-06 08:05:24 -05:00
Charlie Marsh cecd4b166c
Don't mark D205 as fixable in more-lines case (#1682)
Closes #1672.
2023-01-05 23:20:14 -05:00
Charlie Marsh 4ddcdd02d6
Tweak badge logo (#1681) 2023-01-05 23:07:21 -05:00
Charlie Marsh ee4cae97d5 Bump version to 0.0.212 2023-01-05 21:25:42 -05:00
Charlie Marsh 75bb6ad456
Implement duplicate isinstance detection (SIM101) (#1673)
See: #998.
2023-01-05 20:21:40 -05:00
Diego Palacios e6611c4830
Fix flake8-import-conventions configuration examples (#1660) 2023-01-05 13:37:25 -05:00
Maksudul Haque 2d23b1ae69
[`flake8-bandit`] Add Rule for `S506` (unsafe use of yaml load) (#1664)
See: https://github.com/charliermarsh/ruff/issues/1646.

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-05 13:35:01 -05:00
Maksudul Haque 9f8ef1737e
[`flake8-bandit`] Add Rule for `S324` (Insecure hash functions in `hashlib`) (#1661)
ref: https://github.com/charliermarsh/ruff/issues/1646
2023-01-05 11:45:47 -05:00
Martin Fischer 2045b739a9
Stop highlighting --help output in README as shell (#1655)
This PR is meant to address the following obviously unintended GitHub
rendering:

![image](https://user-images.githubusercontent.com/73739153/210713719-7fb465b1-db91-4074-8a0c-4efa3c47c2f4.png)
2023-01-05 09:46:49 -05:00
Martin Fischer 53e3dd8548 Add ignore-overlong-task-comments setting
Imagine a .py file containing the following comment:

    # TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
    # do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Since `git grep` only matches individual lines `git grep TODO` would
only output the first line of the comment, cutting off potentially
important information. (git grep currently doesn't support multiline
grepping). Projects using such a workflow therefore probably format
the comment in a single line instead:

    # TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

This commit introduces a setting to accomdate this workflow by making
the line-length checks (`E501`) optionally ignore overlong lines
if they start with a recognized task tag.

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-04 23:54:50 -05:00
Martin Fischer 78c9056173 Add pycodestyle::settings
This step is split up into a separate commit so
that the following commit has a cleaner diff.
2023-01-04 23:54:50 -05:00
Martin Fischer 8d56e412ef Add task-tags setting
Programmers often leave comments to themselves and others such as:

    # TODO: Use a faster algorithm?

The keywords used to prefix such comments are just a convention and vary
from project to project. Other common keywords include FIXME and HACK.

The keywords in use for the codebase are of interest to ruff because
ruff does also lint comments. For example the ERA lint detects
commented-out code but ignores comments starting with such a keyword.
Previously the ERA lint simply hardcoded the regular expression
TODO|FIXME|XXX to achieve that. This commit introduces a new `task-tags`
setting to make this configurable (and to allow other comment lints to
recognize the same set of keywords).

The term "task tags" has probably been popularized by the Eclipse
IDE.[1] For Python there has been the proposal PEP 350[2], which
referred to such keywords as "codetags". That proposal however has been
rejected. We are choosing the term "task tags" over "code tags" because
the former is more descriptive: a task tag describes a task.

While according to the PEP 350 such keywords are also sometimes used for
non-tasks e.g. NOBUG to describe a well-known problem that will never be
addressed due to design problems or domain limitations, such keywords
are so rare that we are neglecting them here in favor of more
descriptive terminology. The vast majority of such keywords does
describe tasks, so naming the setting "task-tags" is apt.

[1]: https://www.eclipse.org/pdt/help/html/task_tags.htm
[2]: https://peps.python.org/pep-0350/

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-01-04 23:54:50 -05:00
Charlie Marsh 3400be18a6 Revert "Add task-tags & ignore-overlong-task-comments settings (#1550)"
This reverts commit ca48492137.
2023-01-04 23:54:50 -05:00
Charlie Marsh 7b59cd2d32 Bump version to 0.0.211 2023-01-04 23:13:04 -05:00
Charlie Marsh b8ed4d402a
Implement `SIM110` and `SIM111` (conversion to `any` and `all`) (#1653) 2023-01-04 23:08:12 -05:00
messense 46dcf3c4c0
Implement flake8-simplify SIM107 (#1650) 2023-01-04 23:02:25 -05:00
Charlie Marsh fb8024a6ac
Implement nested with detection (SIM117) (#1651) 2023-01-04 21:22:25 -05:00
Edgar R. M 2f71bdfbfc
Implement flake8-bandit rule `S108` (#1644) 2023-01-04 21:11:13 -05:00
Charlie Marsh 30d6688c26
Implement nested-if detection (#1649) 2023-01-04 20:55:01 -05:00
Charlie Marsh 7339d7eccf
Implement builtin import removal (#1645) 2023-01-04 19:10:16 -05:00
Charlie Marsh 980d10b952
Add Ruff badge to README (#1642) 2023-01-04 17:27:01 -05:00
Martin Fischer ca48492137
Add task-tags & ignore-overlong-task-comments settings (#1550) 2023-01-04 17:10:21 -05:00
Charlie Marsh 7c23701b62
Note a few more incompatibilities (#1639) 2023-01-04 16:05:15 -05:00
Charlie Marsh 8da2c4815a
Tweak Yoda condition message (#1638) 2023-01-04 15:58:01 -05:00
Edgar R. M 1817f8752b
Implement flake8-bandit rule `S103` (#1636) 2023-01-04 15:47:38 -05:00
Colin Delahunty 8b8e6e44ea
Adding my company to the "used in" category of the Readme. (#1631) 2023-01-04 12:31:18 -05:00
messense 0df28bdd4e
Implement flake8-simplify SIM105 rule (#1621) 2023-01-04 08:10:59 -05:00
Charlie Marsh 8b07f9517a
Implement `SIM220` and `SIM221` (#1630) 2023-01-04 08:07:00 -05:00
Charlie Marsh 20930b3675
Add some more users to the README (#1623) 2023-01-03 23:06:08 -05:00
Colin Delahunty fb1a638a96
Implement `yield`-to-`yield from` conversion (#1544) 2023-01-03 22:56:52 -05:00
Charlie Marsh aacfc9ee0b Bump version to 0.0.210 2023-01-03 21:46:08 -05:00
Charlie Marsh cc116b0192
Treat convention as setting ignore, rather than select (#1611) 2023-01-03 21:27:53 -05:00
Matt Oberle 03275c9c98
Add isort.order-by-type boolean setting (#1607) 2023-01-03 18:07:44 -05:00
Harutaka Kawamura 8d99e317b8
Implement autofix for `PT022` (#1604) 2023-01-03 13:36:28 -05:00
Charlie Marsh e9a236f740 Bump version to 0.0.209 2023-01-03 08:27:28 -05:00
Pedram Navid da5a25b421
Add autofix for SIM300 (#1588) 2023-01-03 07:19:04 -05:00
jvstme d1389894a4
Fix several typos in README (#1590) 2023-01-03 07:06:43 -05:00
Charlie Marsh 8b277138de Bump version to 0.0.208 2023-01-02 23:19:03 -05:00
Charlie Marsh e0fe34c523
Implement and-false and or-true rules (#1586) 2023-01-02 23:10:42 -05:00
Charlie Marsh 995fee5ddd Increment flake8-pie implementation count 2023-01-02 22:47:05 -05:00
Harutaka Kawamura b351221049
Mark `FStringMissingPlaceholders` as fixable (#1582) 2023-01-02 22:41:40 -05:00
Charlie Marsh 8aeec35bfb
Implement dupe-class-field-definitions (#1581) 2023-01-02 22:26:01 -05:00
Charlie Marsh 93259acb31
Implement unnecessary-pass-statement (#1580) 2023-01-02 22:15:24 -05:00
Charlie Marsh 5dd9e99a4b
Add `flake8-pie` plugin with `prefer_list_builtin` (#1578) 2023-01-02 21:47:38 -05:00
Charlie Marsh 0c05488740
Automatically set baseline D codes based on convention (#1574) 2023-01-02 19:08:56 -05:00
Charlie Marsh e5a59f41b0
Remove extend- from docstring configuration examples (#1571) 2023-01-02 17:53:41 -05:00
Edgar R. M c4014ef2d3
Implement `flake8-pytest-style` (#1506) 2023-01-02 16:34:17 -05:00
Charlie Marsh f74050e5b1 Bump version to 0.0.207 2023-01-02 14:39:32 -05:00
Víctor 06321fd240
Add usage clarification to README (#1557) 2023-01-02 13:40:16 -05:00
Pedram Navid 07e47bef4b
Add flake8-simplify SIM300 check for Yoda Conditions (#1539) 2023-01-01 18:37:40 -05:00
Anders Kaseorg 86b61806a5
Correct UP027 message to “generator expression” (#1540) 2023-01-01 18:30:58 -05:00
Colin Delahunty 65c34c56d6
Implement list-to-tuple comprehension unpacking (#1534) 2023-01-01 16:53:26 -05:00
Charlie Marsh 2315db7d13 Bump version to 0.0.206 2023-01-01 16:39:29 -05:00
Charlie Marsh 8fd0d8e9d8 Bump pyupgrade implementation count 2022-12-31 21:25:34 -05:00
Colin Delahunty 70895a8f1e
Pyupgrade: `import mock` to `from unittest import mock` (#1488) 2022-12-31 21:25:06 -05:00
Charlie Marsh 92c2981b6d
Add dark mode variant for benchmark image (#1519) 2022-12-31 17:47:32 -05:00
Colin Delahunty 4ad8db3d61
Pyupgrade: Turn errors into OSError (#1434) 2022-12-31 16:36:05 -05:00
Charlie Marsh 0e8c237167 Bump version to 0.0.205 2022-12-31 13:44:39 -05:00
Charlie Marsh 0c215365ae Bump version to 0.0.204 2022-12-31 08:20:09 -05:00
Harutaka Kawamura f7bb5bc858
Remove F831 (#1495) 2022-12-30 23:57:51 -05:00
Charlie Marsh 01c74e0629
Add a "fix message" to every autofix-able check (#1489) 2022-12-30 23:16:03 -05:00
Charlie Marsh 248447e139
Trim CLI help during generation (#1492) 2022-12-30 22:03:58 -05:00
Charlie Marsh 74903f23d6 Bump version to 0.0.203 2022-12-30 15:33:30 -05:00
Charlie Marsh 4c2fbb7ac0
Remove hidden autoformat command (#1486) 2022-12-30 15:32:05 -05:00
Reiner Gerecke c9aa7b9308
Generate the README's --help output automatically via cargo +nightly dev generate-all (#1483) 2022-12-30 15:06:32 -05:00
Charlie Marsh 818582fe8a Bump version to 0.0.202 2022-12-30 08:16:32 -05:00
Martin Fischer 87681697ae
Improve CLI help for `--select` (#1471) 2022-12-30 07:16:44 -05:00
Charlie Marsh 4a6e5d1549 Bump version to 0.0.201 2022-12-29 23:01:35 -05:00
Charlie Marsh b078050732
Implicit flake8-implicit-str-concat (#1463) 2022-12-29 23:00:55 -05:00
Martin Fischer 9d34da23bd
Implement TID251 (banning modules & module members) (#1436) 2022-12-29 22:11:12 -05:00
Colin Delahunty f735660801
Removed unicode literals (#1448) 2022-12-29 20:11:33 -05:00
Adam Turner 091d36cd30
Add Sphinx to user list (#1451) 2022-12-29 18:06:09 -05:00
Mathieu Kniewallner 02f156c6cb
docs(README): add missing `flake8-simplify` (#1449) 2022-12-29 17:02:26 -05:00
Charlie Marsh 118a93260a Bump version to 0.0.200 2022-12-29 13:31:23 -05:00
Charlie Marsh 1c16255884
Include docstrings for settings enum members (#1446) 2022-12-29 13:15:44 -05:00
Charlie Marsh 0ba3989b3d
Make update check enablement cofnigurable (#1445) 2022-12-29 13:06:22 -05:00
Maksudul Haque 781bbbc286
[pygrep-hooks] Adds Check for Blanket `# noqa` (#1440) 2022-12-29 12:43:16 -05:00
Charlie Marsh acf0b82f19
Re-style the Ruff playground (#1438) 2022-12-29 11:47:27 -05:00
Charlie Marsh 057414ddd4 Bump version to 0.0.199 2022-12-28 20:58:43 -05:00
Charlie Marsh 058ee8e6bf
Add a --diff flag to dry-run autofixes (#1431) 2022-12-28 19:21:29 -05:00
Colin Delahunty 34842b4c4b
PyUpgrade: Replace pipes with `capture_output=True` (#1415) 2022-12-28 16:53:35 -05:00
Colin Delahunty 6131c819ed
Rewrite xml.etree.cElementTree to xml.etree.ElementTree (#1426) 2022-12-28 16:30:36 -05:00
Maksudul Haque 8e479628f2
Add Support for GitLab CI Code Quality Report Format (#1424) 2022-12-28 10:10:43 -05:00
Charlie Marsh c679570041 Bump version to 0.0.198 2022-12-27 21:39:53 -05:00
Charlie Marsh edcb3a7217
Support --select ALL to enable all error codes (#1418) 2022-12-27 21:38:26 -05:00
Charlie Marsh 6e43dc7270
Add nbQA support to the docs (#1417) 2022-12-27 21:24:07 -05:00
Charlie Marsh 570d0864f2
Add rule to detect keyword arguments before starred arguments (#1416) 2022-12-27 21:17:22 -05:00
Charlie Marsh 043d31dcdf Bump version to 0.0.197 2022-12-27 17:05:15 -05:00
Charlie Marsh 3e96803033 Bump version to 0.0.196 2022-12-27 12:02:02 -05:00
Colin Delahunty c59035139c
Pyupgrade: converts `universal_newlines` to `text` in `subprocess.run` (#1403) 2022-12-27 12:01:27 -05:00
Charlie Marsh 7632d7eda7
Allow specification of explicit docstring convention (#1408) 2022-12-27 11:50:28 -05:00
Reiner Gerecke 534d8d049c
Support isort's force-single-line option (#1366) 2022-12-27 08:51:32 -05:00
Reiner Gerecke e0b39fa63e
Implement pyupgrade check for io.open alias (#1399) 2022-12-27 07:47:40 -05:00
Charlie Marsh 320a48977b Tweak README again 2022-12-26 21:17:18 -05:00
Charlie Marsh 0d05aaeb6e Add monorepo note 2022-12-26 21:00:14 -05:00
Charlie Marsh 1e4b1533ad Bump version to 0.0.195 2022-12-26 20:41:39 -05:00
Charlie Marsh df4f5358f9 Bump pyupgrade implementation count 2022-12-26 19:56:12 -05:00
Colin Delahunty 58c383401c
Replace `typing.Text` with `str` (#1391) 2022-12-26 19:55:41 -05:00
Colin Delahunty debd909b2c
Magic Trailing Commas in isort (#1363) 2022-12-26 09:40:02 -05:00
Charlie Marsh b0f30bef8f
Add support for `ruff.toml` (#1378) 2022-12-25 21:55:07 -05:00
Charlie Marsh 4dc45912e8 Run cargo dev commands 2022-12-25 20:12:12 -05:00
Charlie Marsh 5ef8bff341 Bump version to 0.0.194 2022-12-25 19:54:45 -05:00
Charlie Marsh 2ab8f77223 Update command-line help text 2022-12-25 19:54:14 -05:00
Charlie Marsh 8b72f55a09
Add `--required-version` (#1376) 2022-12-25 19:53:50 -05:00
Charlie Marsh d9355c989a
Add a `--fix-only` command-line and `pyproject.toml` option (#1375) 2022-12-25 18:49:56 -05:00
Charlie Marsh cc2110449c Run cargo dev commands 2022-12-24 15:06:12 -05:00
Charlie Marsh f6ca49e05f Bump version to 0.0.193 2022-12-24 14:56:26 -05:00
Edgar R. M 4888afd423
Generate JSON schema for Ruff options (#1329) 2022-12-24 14:10:22 -05:00
Sawbez 0dc523b081
Add autofix for W605 [InvalidEscapeSequence] (#1361) 2022-12-24 13:46:28 -05:00
Sawbez 4ded155dc0
Add autofix for W292 [NoNewLineAtEndOfFile] (#1354) 2022-12-23 23:14:17 -05:00
Reiner Gerecke 102b049a32
Add cache-dir to command-line and pyproject.toml (#1351) 2022-12-23 22:58:29 -05:00
Charlie Marsh 74f49eda64
Bump compatibility to 3.11 (#1352) 2022-12-23 12:12:11 -05:00
Reiner Gerecke 9da3e2cca1
Implement "native literals" check from pyupgrade (#1350) 2022-12-23 11:40:32 -05:00
Charlie Marsh bc9ed0a4ef Tweak LSP docs 2022-12-22 22:16:32 -05:00
Charlie Marsh 20b9b44973 Link to ruff-lsp docs 2022-12-22 21:53:11 -05:00
Charlie Marsh 6e5a553235 Update Neovim instructions 2022-12-22 21:52:30 -05:00
Charlie Marsh 2a08a63f17
Add a link to the PyCharm plugin (#1345) 2022-12-22 21:50:24 -05:00
Charlie Marsh 51bda28a7d Bump version to 0.0.192 2022-12-22 17:31:31 -05:00
Reiner Gerecke cc26051b7a
Implement "datetime.UTC alias" check from pyupgrade (#1341) 2022-12-22 17:21:36 -05:00
Charlie Marsh 970f882b03
Set force-exclude for pre-commit in README (#1337) 2022-12-22 10:51:20 -05:00
Charlie Marsh a4a24a0ef3
Add some more repositories to the user list (#1328) 2022-12-21 22:16:47 -05:00
Charlie Marsh 03e4f5be8a Bump version to 0.0.191 2022-12-21 21:16:21 -05:00
Charlie Marsh 99657b7d92
Implement E401 ("multiple imports on one line") (#1326) 2022-12-21 21:15:57 -05:00
Charlie Marsh ff66d08cef Run generate-options 2022-12-21 20:58:14 -05:00
Charlie Marsh bf5fec342c
Support shell expansion in `extend` paths (#1323) 2022-12-21 20:46:38 -05:00
Charlie Marsh 20234c6156 Bump version to 0.0.190 2022-12-21 16:01:48 -05:00
Charlie Marsh ef8fe31c0c Bump version to 0.0.189 2022-12-20 13:26:17 -05:00
Charlie Marsh a61126ab23 Run generate-options 2022-12-19 23:19:05 -05:00
Charlie Marsh 4107bc828d Bump version to 0.0.188 2022-12-19 12:18:06 -05:00
Charlie Marsh 706d28cabc
Rename PDV checks to PD (#1288) 2022-12-19 00:20:28 -05:00
Yasu_umi 8a4831dd5b
Implement flake8-datetimez (#1270) 2022-12-18 22:06:06 -05:00
Charlie Marsh b5ab492a70 Bump version to 0.0.187 2022-12-18 20:09:02 -05:00
Charlie Marsh 6cf047976c Bump pygrep-hooks tally in README 2022-12-18 18:05:32 -05:00
Reiner Gerecke 87465daacc
pygrep-hooks - deprecated use of logging.warn & no blanket type ignore (#1275) 2022-12-18 18:04:21 -05:00
Charlie Marsh 1028ed3565 Bump version to 0.0.186 2022-12-18 14:30:30 -05:00
Anders Kaseorg 98897db6ac
Add packaging status badge from repology (#1276) 2022-12-18 14:27:29 -05:00
Honkertonken 5ce4262112
Readme : Fix incorrect exmaple. (#1277) 2022-12-18 12:04:48 -05:00
Anders Kaseorg 04b1e1de6f
README: Add missing backtick (#1274) 2022-12-18 00:29:33 -05:00
Anders Kaseorg c93c85300f
Repair corrupted PDV007, PDV009 messages (#1273) 2022-12-18 00:29:12 -05:00
Charlie Marsh 73ed6f8654 Touch-up README 2022-12-17 21:38:45 -05:00
Charlie Marsh f366b0147f
Add ruff-lsp to README (#1272) 2022-12-17 21:35:44 -05:00
Charlie Marsh fc88fa35ff
Add instructions for Sublime Text installation (#1271) 2022-12-17 16:22:50 -05:00
Charlie Marsh a2806eb8ef Bump version to 0.0.185 2022-12-16 23:47:56 -05:00
Charlie Marsh 1e19142d0e Bump version to 0.0.184 2022-12-16 14:36:25 -05:00
Charlie Marsh d6e765877e
Enable autofix for __init__ method with missing None-return (#1265) 2022-12-16 14:28:56 -05:00
Charlie Marsh 634553f188
Add ignore-variadic-names options to flake8-unused-arguments (#1261) 2022-12-16 00:22:38 -05:00
Charlie Marsh 481d668511 Add flake8-errmsg to README 2022-12-15 23:16:38 -05:00
Charlie Marsh a9f56ee76e Bump version to 0.0.183 2022-12-15 23:15:12 -05:00
Edgar R. M 8281d414ca
Implement `flake8-errmsg` (#1258) 2022-12-15 23:10:59 -05:00
Martin Lehoux d8b4b92733
Implement U016: Remove six compatibility code (#1013) 2022-12-15 14:16:58 -05:00
Edgar R. M 27de342e75
Implement `pandas-vet` (#1235) 2022-12-15 14:01:01 -05:00
Charlie Marsh 1ea2e93f8e Bump version to 0.0.182 2022-12-14 22:57:22 -05:00
Charlie Marsh 549ea2f85f
Ignore any `pyproject.toml` without a `[tool.ruff]` section (#1243) 2022-12-14 19:35:52 -05:00
Charlie Marsh d814ebd21f Bump version to 0.0.181 2022-12-14 17:35:36 -05:00
Charlie Marsh 3f272b6cf8
Enable opt-out of `.gitignore` checks via `respect-gitignore` flag (#1242) 2022-12-14 16:54:23 -05:00
Charlie Marsh 854cd14842 Bump version to 0.0.180 2022-12-14 13:21:10 -05:00
Charlie Marsh 765d21c7b0 Bump version to 0.0.179 2022-12-13 10:17:16 -05:00
Charlie Marsh a58b9b5063
Upgrade RustPython to support parenthesized context managers (#1228) 2022-12-13 10:16:43 -05:00
Charlie Marsh f3e11a30cb Bump version to 0.0.178 2022-12-12 22:06:04 -05:00
Charlie Marsh 2f3b5367ff Add a note on extends to README 2022-12-12 21:36:39 -05:00
Charlie Marsh 92bc417e4e
Add support for glob patterns in `src` (#1225) 2022-12-12 21:35:03 -05:00
Charlie Marsh 9853b0728b
Enable configuration files to "extend" other configuration files (#1219) 2022-12-12 20:28:22 -05:00
Charlie Marsh 77709dcc41 Remove underscore from extend_exclude 2022-12-12 16:34:16 -05:00
Charlie Marsh b0cb5fc7ef
Document current behavior around `pyproject.toml` discovery (#1213) 2022-12-12 11:49:21 -05:00
Charlie Marsh 19e9eb1af8 Bump version to 0.0.177 2022-12-11 22:38:52 -05:00
Anders Kaseorg e57044800c
Fix quotes in SIM118 error message (#1204) 2022-12-11 22:30:39 -05:00
Charlie Marsh ae8ff7cb7f
Add notes around python-lsp-ruff (#1202) 2022-12-11 17:36:20 -05:00
Charlie Marsh 24179655b8 Fix 'a test' reference 2022-12-11 13:31:14 -05:00
Charlie Marsh d27b419e68 Run cargo dev generate-options 2022-12-11 10:34:52 -05:00
Charlie Marsh 9fc7a32a24 Sort list in README 2022-12-11 10:25:27 -05:00
Charlie Marsh 9161b866b5 Bump version to 0.0.176 2022-12-11 10:19:50 -05:00
Charlie Marsh 99f077aa4e Add missing hash in README comment 2022-12-11 10:05:32 -05:00
Reiner Gerecke 7f25d1ec70
Implement SIM118 (key in dict) of flake8-simplify (#1195) 2022-12-11 10:05:11 -05:00
Reiner Gerecke 247dcc9f9c
Mark C413 as fixable (#1191) 2022-12-11 09:07:51 -05:00
Charlie Marsh c86e52193c Bump version to 0.0.175 2022-12-10 21:23:19 -05:00
Reiner Gerecke 06ed125771
Add autofix for F504 and F522 (#1184) 2022-12-10 16:33:09 -05:00
Charlie Marsh 6da3de25ba
Add jupyter_server to README (#1182) 2022-12-10 12:10:27 -05:00
Charlie Marsh 63b3e00c97 Bump version to 0.0.174 2022-12-10 12:08:48 -05:00
Charlie Marsh b8bbafd85b
Flag global usages prior to `global` declarations (#1178) 2022-12-10 11:19:24 -05:00
Charlie Marsh 2b44941d63
Add pacman instructions to README (#1175) 2022-12-10 10:00:01 -05:00
Charlie Marsh 257bd7f1d7 Bump version to 0.0.173 2022-12-09 23:23:12 -05:00
Charlie Marsh b35a804f9d Bump version to 0.0.172 2022-12-09 17:47:34 -05:00
Charlie Marsh e594ed6528
Implement D301 (backslash checks) (#1169) 2022-12-09 17:44:18 -05:00
Charlie Marsh 0dacf61153
Implement F842 (UnusedAnnotation) (#1165) 2022-12-09 12:42:03 -05:00
Charlie Marsh 2965e2561d
Clarify combination of combine-as-imports and force-wrap-aliases (#1162) 2022-12-09 12:20:15 -05:00
Charlie Marsh a19050b8a4 Update README.md 2022-12-08 23:39:01 -05:00
Charlie Marsh dfd6225d85 Bump version to 0.0.171 2022-12-08 23:18:48 -05:00
Charlie Marsh aaeab0ecf1
Implement F811 (`RedefinedWhileUnused`) (#1137) 2022-12-08 21:31:08 -05:00
Charlie Marsh a710e35ebc Bump version to 0.0.170 2022-12-08 11:36:24 -05:00
Charlie Marsh e338d9acbe
Remove 'consider' language from check messages (#1135) 2022-12-07 20:10:36 -05:00
Charlie Marsh 5c8655f479 Bump ruff_macros to 0.0.169 2022-12-07 19:10:16 -05:00
Charlie Marsh 528416f07a
Rename I252 to TID252; add redirects for all renamed codes (#1129) 2022-12-07 15:12:22 -05:00
Charlie Marsh 4405a6a903 Bump version to 0.0.168 2022-12-07 13:18:40 -05:00
Charlie Marsh bb67fbb73a
Implement unused argument detection (`ARG`) (#1126)
Detect unused arguments
2022-12-07 12:15:41 -05:00
Charlie Marsh d698c6123e Bump version to 0.0.167 2022-12-07 10:37:31 -05:00
Charlie Marsh 9579faffa8
Avoid flagging bare exception issues when exception is re-raised (#1124) 2022-12-07 10:37:08 -05:00
Phillip Verheyden 9c6e8c7644
Auto-generate the rules table of contents (#1121) 2022-12-07 10:03:42 -05:00
Charlie Marsh 7abecd4f0e
Implement B905 (#1122) 2022-12-07 10:01:24 -05:00
Phillip Verheyden b8ff209af8
Encode prefixes in README headings not just in TOC (#1109) 2022-12-07 09:24:49 -05:00
Edgar R. M f2ac8c4ec2
Add `flake8-import-conventions` to TOC in readme (#1114) 2022-12-06 21:27:04 -05:00
Charlie Marsh 80e2f0c92e Bump version to 0.0.166 2022-12-06 16:06:19 -05:00
Edgar R. M ea550abd3c
Implement `flake8-import-conventions` (#1098) 2022-12-06 16:01:17 -05:00
Laurent Baillet 6eb6b6eede
Update readme in order to match pylint prefixes (#1105) 2022-12-06 08:59:45 -05:00
Charlie Marsh f1d3e3698a Bump version to 0.0.165 2022-12-06 00:03:30 -05:00
Charlie Marsh f2ad915224 Bump version to 0.0.164 2022-12-05 23:37:22 -05:00
Reiner Gerecke 982ac6b0ad
Auto-generate options in README from field attributes (#1015) 2022-12-05 22:34:40 -05:00
Charlie Marsh 1339e2a002 Bump version to 0.0.163 2022-12-05 20:45:24 -05:00
Charlie Marsh 436aeed20a
Implement autofix for D400 and D415 (#1094) 2022-12-05 20:24:56 -05:00
Charlie Marsh 995994be3e Bump version to 0.0.162 2022-12-05 19:07:44 -05:00
Charlie Marsh 4b41ae3f53 Bump version to 0.0.161 2022-12-05 17:02:05 -05:00
Charlie Marsh f944e1e1cf
Add action comments to README.md (#1082) 2022-12-05 16:56:28 -05:00
Charlie Marsh 40b7c64f7d Bump version to 0.0.160 2022-12-05 12:56:38 -05:00
Jonathan Plasse a76c5d1226
Add allowed-confusable settings (#1059) 2022-12-05 12:53:55 -05:00
Charlie Marsh 1d1662cb9c Bump version to 0.0.159 2022-12-05 11:22:02 -05:00
Charlie Marsh 7024ad7cc7 Bump version to 0.0.158 2022-12-04 21:22:24 -05:00
Charlie Marsh 871ac511ae
Add an option to force one-member-per-line for aliased import-froms (#1047) 2022-12-04 21:22:00 -05:00
Charlie Marsh 5e9a8fcf53 Bump version to 0.0.157 2022-12-04 14:46:46 -05:00
Charlie Marsh 76439235af
Remove unused imports in `__init__.py` files by default (#1042) 2022-12-04 14:45:54 -05:00
Charlie Marsh d06dc4c72d Bump version to 0.0.156 2022-12-04 10:22:09 -05:00
Jonathan Plasse 8f6b2fb32b
Extend and rename RUF004 to PLR1722 (#1036) 2022-12-04 10:20:12 -05:00
Harutaka Kawamura abb2adc4d8
Implement `useless-import-alias` (#1025) 2022-12-04 09:48:56 -05:00
Harutaka Kawamura e070166409
Implement useless-else-on-loop (#1031) 2022-12-04 09:22:04 -05:00
Jonathan Plasse 0ae6890094
Fix Table of Contents (#1030) 2022-12-04 09:14:09 -05:00
Jakub Kuczys 4994b72ba2
Fix README header links in isort config section (#1033) 2022-12-04 09:12:25 -05:00
Charlie Marsh 4b0c3e3bc9 Bump version to 0.0.155 2022-12-04 00:12:00 -05:00
Charlie Marsh ddae3586d5
Add support for combine-as-imports import formatting (#1022) 2022-12-04 00:11:48 -05:00
Charlie Marsh 97684b7215 Mark MisplacedComparisonConstant as fixable 2022-12-04 00:11:19 -05:00
Harutaka Kawamura 20e6ff112a
Implement `misplaced-comparison-constant` (#1023) 2022-12-04 00:10:07 -05:00
Charlie Marsh 6cb84d29f0
Rename M001 to RUF100 (#1021) 2022-12-03 22:51:05 -05:00
Charlie Marsh c659cb86d9
Rename RUF101 to RUF004 (#1020) 2022-12-03 22:46:13 -05:00
Harutaka Kawamura 58e7baedd0
Implement `consider-using-from-import` (#1018) 2022-12-03 22:36:43 -05:00
Charlie Marsh 00eff2b09a
Rename pyupgrade rules from UXXX to UPXXX (#957) 2022-12-03 22:35:42 -05:00
Charlie Marsh b6b509811d Bump version to 0.0.154 2022-12-03 20:14:38 -05:00
Charlie Marsh 87bdda3cfa
Make some `flake8-return` rules auto-fixable (#1017) 2022-12-03 20:13:17 -05:00
Charlie Marsh 291727a27d
Implement `flake8-return` plugin (#1016) 2022-12-03 20:12:11 -05:00
Charlie Marsh e66b786229 Bump version to 0.0.153 2022-12-03 17:05:39 -05:00
Harutaka Kawamura e05e1cdf76
Implement `consider-merging-isinstance` (#1009) 2022-12-03 16:51:53 -05:00
Harutaka Kawamura ebd2181946
Implement `unnecessary-direct-lambda-call` (#1008) 2022-12-03 09:59:04 -05:00
Harutaka Kawamura 115e85b47d
Rename PLE0206 to PLR0206 (#1006) 2022-12-03 00:14:46 -05:00
Harutaka Kawamura 31a3314ebd
Implement PLE0206 (#1005) 2022-12-03 00:04:43 -05:00
Charlie Marsh bf33025ea9
Support whole-file noqa exclusions (#1001) 2022-12-02 23:56:56 -05:00
Charlie Marsh 1a33ee3fc4 Bump version to 0.0.152 2022-12-02 13:23:00 -05:00
Jonathan Plasse 117fcb6936
Add no-eval rule from pygrep-hooks (#994) 2022-12-02 12:59:06 -05:00
Charlie Marsh 1a24d78f67 Bump version to 0.0.151 2022-12-01 22:31:44 -05:00
Charlie Marsh d699bb7b86 Bump version to 0.0.150 2022-12-01 16:31:18 -05:00
Charlie Marsh 6fe478cb43
Add Conda installation instructions (#982) 2022-12-01 12:19:39 -05:00
Edgar R. M 6f48ac6c0b
Add GitHub output format (#975) 2022-12-01 10:22:11 -05:00
Charlie Marsh f6b0a606d6
Implement await-outside-async / E1142 (#972) 2022-11-30 11:38:03 -05:00
Charlie Marsh 6fa0f21227 Bump version to 0.0.149 2022-11-30 00:51:36 -05:00
messense f5466fe720
Add JUnit xml output format (#968) 2022-11-30 00:47:41 -05:00
Charlie Marsh a0202e8eb2
Add Pylint parity to FAQ (#969) 2022-11-29 23:51:27 -05:00
Charlie Marsh 30ff4de9a3 Bump version to 0.0.148 2022-11-29 22:50:30 -05:00
Charlie Marsh 2fe22a223b Bump version to 0.0.147 2022-11-29 20:17:58 -05:00
Charlie Marsh e762dec677 Add one more note to README 2022-11-29 20:17:46 -05:00
Charlie Marsh 808b348c5f Add W to pycodestyle list in README 2022-11-29 20:09:07 -05:00
Charlie Marsh e55daa89e6
Uses dashes for README options (#966) 2022-11-29 20:08:03 -05:00
Charlie Marsh b8e7d86696
Add pyupgrade's --keep-runtime-typing option (#965) 2022-11-29 20:05:32 -05:00
Charlie Marsh ced7868559
Add format setting to pyproject.toml (#964) 2022-11-29 19:22:23 -05:00
Hayden ca38c7ac48
Grouped format implementation (#954) 2022-11-29 18:45:16 -05:00
Guillaume Andreu Sabater 602291c0c2
README: fixed conf section typo (#959) 2022-11-29 09:27:02 -05:00
Charlie Marsh 0e6a38e6d8 Bump version to 0.0.146 2022-11-28 22:27:41 -05:00
Charlie Marsh 058fd8748d Re-generate check code prefix and rules table 2022-11-28 22:26:32 -05:00
Charlie Marsh ea73c717be
Remove pre-commit note in README.md (#956) 2022-11-28 22:18:59 -05:00
Charlie Marsh 427e0c3158
Allow preservation of external check codes (#955) 2022-11-28 22:16:17 -05:00
Charlie Marsh dca994d05f Bump version to 0.0.145 2022-11-28 20:57:58 -05:00
Charlie Marsh 82b0b7941a
Implement eradicate (#947) 2022-11-28 20:54:33 -05:00
Charlie Marsh 72453695d6 Bump version to 0.0.144 2022-11-28 20:11:08 -05:00
Charlie Marsh ea9acda732 Bump version to 0.0.143 2022-11-28 15:42:25 -05:00
Charlie Marsh e2c4a098de Bump version to 0.0.142 2022-11-28 00:19:27 -05:00
Charlie Marsh e865f58426
Add all plugin options to README reference (#936) 2022-11-28 00:19:14 -05:00
Charlie Marsh ae2ac905dc
Document all top-level configuration options (#934) 2022-11-27 23:50:24 -05:00
Charlie Marsh 16da183f8e
Add some user testimonials (#932) 2022-11-27 21:55:01 -05:00
Charlie Marsh 3f689917cb
Use alternative TOML format for per-file-ignores in README (#931) 2022-11-27 21:38:43 -05:00
Charlie Marsh a4a215e8a3
Add Homebrew installation to README (#930) 2022-11-27 21:37:34 -05:00
Charlie Marsh aa1c884910 Tweak Flake8 parity in README 2022-11-27 21:34:47 -05:00
Oliver Margetts 7fb55c6d99
F50x implementation (#919) 2022-11-27 21:30:55 -05:00
Charlie Marsh 9897f81cf3 Bump version to 0.0.141 2022-11-26 16:33:08 -05:00
Denis Gavrilyuk 721a1e9443
Add flake8-debugger (#909) 2022-11-26 16:21:03 -05:00
Charlie Marsh 14cf36f922 Bump version to 0.0.140 2022-11-26 15:05:46 -05:00
Charlie Marsh 560558b814 Bump version to 0.0.139 2022-11-25 18:38:26 -05:00
Charlie Marsh 7445d00b88
Implement B023 (function uses loop variable) (#907) 2022-11-25 18:29:54 -05:00
Oliver Margetts 8b14f1b8cc
Implement F522-F525 (#899) 2022-11-25 13:14:31 -05:00
Xuan (Sean) Hu 5a6b51e623
Minor changes in README. (#903) 2022-11-25 09:49:16 -05:00
Charlie Marsh 0b60242fb7 Bump version to 0.0.138 2022-11-25 00:05:41 -05:00
Charlie Marsh b50016fe89 Regenerate README.md 2022-11-24 18:10:07 -05:00
Harutaka Kawamura 33fbef7700
Implement B904 (#892) 2022-11-24 09:49:57 -05:00
Charlie Marsh 68668a584b Bump version to 0.0.137 2022-11-23 20:28:45 -05:00
Charlie Marsh 58aac21a36 Bump version to 0.0.136 2022-11-23 17:41:17 -05:00
Charlie Marsh 66975876b2 Bump version to 0.0.135 2022-11-22 19:21:53 -05:00
Charlie Marsh c3f6170503
Update README with list of projects (#874) 2022-11-22 14:28:02 -05:00
Andri Bergsson ce116a80ad
Automatically remove redundant open modes #640 (#843) 2022-11-21 16:06:41 -05:00
Charlie Marsh 1559671093 Target isort code in README.md 2022-11-21 13:38:01 -05:00
Charlie Marsh b1f9c7b6bd Update default complexity in README.md 2022-11-21 13:19:55 -05:00
Harutaka Kawamura 89980ad651
Implement autofix for B013 (#824) 2022-11-20 18:49:07 -05:00
Jonathan Plasse 7cab541343
Add convert exit() to sys.exit() rule (#816) 2022-11-20 18:09:40 -05:00
Martin Lehoux 40f38c94a5
Implement U014: Convert NamedTuple function to class (#819) 2022-11-20 10:26:15 -05:00
Harutaka Kawamura 7839204bf7
Implement autofix for B010 (#823) 2022-11-20 10:14:29 -05:00
Harutaka Kawamura 13e8ed0a0a
Implement autofix for E731 (#814) 2022-11-19 19:51:41 -05:00
Charlie Marsh 0f34cdb7a3
Enable customization of autofixable error codes (#811) 2022-11-18 18:49:13 -05:00
Harutaka Kawamura e81efa5a3d
Implement a `--show-source` setting (#698) 2022-11-18 14:02:29 -05:00
Jonathan Plasse b74fd1fe13
Change error code of flake8-blind-except (#808) 2022-11-18 13:30:36 -05:00
Charlie Marsh 9c4d24a452 Add flake8-boolean-trap to README 2022-11-18 12:36:13 -05:00
pwoolvett 7a4449eacb
Add flake8-boolean-trap (#790) 2022-11-18 12:30:07 -05:00
Harutaka Kawamura 6ffe767252
Implement autofix for E713 and E714 (#804) 2022-11-18 12:16:11 -05:00
Jonathan Plasse 2f894e3951
Add flake8-blind-except (#805) 2022-11-18 12:15:10 -05:00
Martin Lehoux c5722d8a4d
Implement U013: Unnecessary TypedDict syntactic form (#716) 2022-11-18 12:10:47 -05:00
Jonathan Plasse c2d6307e9b
Add missing plugins in some sections of README.md (#802) 2022-11-18 09:28:33 -05:00
Edgar R. M f44fada446
Implement C901 (mccabe) (#765) 2022-11-17 17:40:50 -05:00
Charlie Marsh aafddae644 Bump version to 0.0.125 2022-11-17 12:07:05 -05:00
Charlie Marsh 749df87de0
Tweak presentation of `null-ls` and `efm` docs (#791) 2022-11-17 12:04:11 -05:00
Eddie Bergman d67db33f22
docs(integrations): neovim `null-ls` integration (#782) 2022-11-17 11:55:08 -05:00
Charlie Marsh f0a54716e5
Implement flake8-tidy-imports (#789) 2022-11-17 11:44:06 -05:00
Harutaka Kawamura c59e1ff0b5
Implement auto-fix for E711 and E712 (#784) 2022-11-17 11:43:44 -05:00
Jonathan Plasse ecf858cf16
Add the tools identifier in the TOC (#779) 2022-11-17 11:34:32 -05:00
Jonathan Plasse 8063aee006
Remove unnecessary abspath rule (U002) (#781) 2022-11-17 11:29:42 -05:00
Harutaka Kawamura 1821c07367
Implement B020 (#753) 2022-11-15 16:17:03 -05:00
Charlie Marsh 0d3fac1bf9
Add --line-length command line argument (#759) 2022-11-15 12:23:38 -05:00
Edgar R. M 85b2a9920f
docs: Add `flake8-bandit` to ToC (#750) 2022-11-15 00:11:39 -05:00
Brett Cannon 58bcffbe2d
Add isort to the README's ToC (#745) 2022-11-14 18:51:39 -05:00
Harutaka Kawamura 9047bf680d
Implement B024 and B027 (#738) 2022-11-14 13:12:23 -05:00
Harutaka Kawamura a8159f9893
Implement B022 (#734) 2022-11-14 09:24:05 -05:00
Charlie Marsh ce3c45a361
Make `combine-as-imports` the default import sorting behavior (#731) 2022-11-13 23:07:13 -05:00
Charlie Marsh 29ae6c159d
Add FastAPI to README (#730) 2022-11-13 22:27:35 -05:00
Brett Cannon d2d84cf5bf
Fix Markdown in README (#727) 2022-11-13 15:19:25 -05:00
Charlie Marsh a310aed128 Bump version to 0.0.116 2022-11-13 13:46:05 -05:00
Harutaka Kawamura 84bf36194b
Implement B012 (#718) 2022-11-13 11:55:33 -05:00
Harutaka Kawamura e4d168bb4f
Implement B021 (#719) 2022-11-13 11:40:24 -05:00
Charlie Marsh 439642addf Regenerate README 2022-11-13 10:55:14 -05:00
Charlie Marsh 8f99705795 Make some error messages more grammatically consistent 2022-11-12 16:57:23 -05:00
Charlie Marsh 9ec7e6bcd6 Add function name to B008 message 2022-11-12 16:53:13 -05:00
Charlie Marsh 695b06ba60 Bump version to 0.0.115 2022-11-12 16:46:26 -05:00
Edgar R. M 1b422a7f12
Add `flake8-bandit` (#697) 2022-11-12 12:04:49 -05:00
Charlie Marsh da051624e4 Add backticks around functools.lru_cache 2022-11-12 11:56:23 -05:00
Charlie Marsh da9ae6a42a Bump version to 0.0.114 2022-11-12 11:55:18 -05:00
Martin Lehoux afa59d78bb
feat: no unnecessary encode utf8 (#686) 2022-11-12 11:54:36 -05:00
Chammika Mannakkara 6bcc11a90f
add fixes for __future__ import removal (#682) 2022-11-12 11:28:05 -05:00
Harutaka Kawamura 6f36e5dd25
Implement B019 (#695) 2022-11-12 11:14:03 -05:00
Charlie Marsh a21fe716f2 Bump version to 0.0.113 2022-11-11 22:42:02 -05:00
Anders Kaseorg 5a8b7c1d20
Implement flake8-2020 (sys.version, sys.version_info misuse) (#688) 2022-11-11 20:39:37 -05:00
Charlie Marsh 2e7878ff48 Bump version to 0.0.112 2022-11-11 17:13:04 -05:00
Charlie Marsh 560c00ff9d Bump version to 0.0.111 2022-11-11 12:38:23 -05:00
Charlie Marsh 4123ba9851 Add backticks around setattr 2022-11-11 11:08:22 -05:00
Harutaka Kawamura e727c24f79
Implement autofix for B009 (#684) 2022-11-11 11:06:47 -05:00
Harutaka Kawamura bd3b40688f
Implement B010 (#683) 2022-11-11 10:26:37 -05:00
Charlie Marsh b5549382a7
Clarify a few settings for isort behavior (#676) 2022-11-10 23:19:51 -05:00
Charlie Marsh 8cf745045f Bump version to 0.0.110 2022-11-10 19:22:45 -05:00
Charlie Marsh 3cc74c0564
Implement import sorting (#633) 2022-11-10 19:05:56 -05:00
Harutaka Kawamura 1888f6d41b
Implement B009 (#669) 2022-11-10 13:52:20 -05:00
Charlie Marsh 9d8cd2d2fe Bump version to 0.0.109 2022-11-10 10:54:27 -05:00
Harutaka Kawamura 05c19f0091
Implement B026 (#668) 2022-11-10 10:47:42 -05:00
Chammika Mannakkara ff0f5968fa
Detect unnecessary params in `lru_cache` (#664) 2022-11-09 10:02:48 -05:00
Charlie Marsh 1347b7ebb6
Add notes to README on editor integrations (#655) 2022-11-08 16:12:42 -05:00
Charlie Marsh f572acab30 Bump version to 0.0.108 2022-11-08 13:20:35 -05:00
Edgar R. M 24aa177912
Implement ANN401 (#657) 2022-11-08 09:49:44 -05:00
Reiner Gerecke 2ddc768412
Implement fix for C404 (#656) 2022-11-08 09:37:17 -05:00
Chammika Mannakkara 0f9508f549
Remove unnecessary __future__ imports (#634) 2022-11-07 22:26:57 -05:00
Charlie Marsh 7c3d387abd
Implement confusing unicode character detection for comments (#653) 2022-11-07 21:16:34 -05:00
Charlie Marsh 43383bb696 Bump version to 0.0.107 2022-11-07 16:39:03 -05:00
Charlie Marsh 16c5ac1e91 Bump version to 0.0.106 2022-11-07 15:32:54 -05:00
Charlie Marsh da39cddccb
Include function and argument names in ANN checks (#648) 2022-11-07 15:27:03 -05:00
Charlie Marsh de6435f41d
Add a flake8-to-ruff mention (#644) 2022-11-07 10:59:47 -05:00
Charlie Marsh 589ae48f8c Update --help 2022-11-07 10:41:04 -05:00
Harutaka Kawamura 35cc3094b5
Implement B005 (#643) 2022-11-07 10:10:59 -05:00
Harutaka Kawamura 7773e9728b
Implement B004 (#638) 2022-11-07 09:25:09 -05:00
Charlie Marsh 7f77ed0f86 Bump version to 0.0.105 2022-11-06 21:17:00 -05:00
Charlie Marsh 99d9aa61bf
Implement flake8-annotations (#625) 2022-11-06 17:25:49 -05:00
Charlie Marsh 050f34dd25 Bump version to 0.0.104 2022-11-06 15:31:10 -05:00
Reiner Gerecke 1ede377402
Improve discoverability of dev commands (#621) 2022-11-06 14:25:59 -05:00
Reiner Gerecke 82eff641fb
Remove utf-8 encoding declaration (#618) 2022-11-06 14:23:06 -05:00
Reiner Gerecke df88504dea
pyflakes F632 Autofix (#612) 2022-11-06 06:57:46 -05:00
Charlie Marsh 22cfd03b13 Bump ruff_dev to v0.0.103 2022-11-05 19:53:27 -04:00
Anders Kaseorg 95073b1586
Fix “Code” misspelling (#614) 2022-11-05 19:28:52 -04:00
Charlie Marsh 3597a94818
Add a README link to each plugin (#611) 2022-11-05 16:18:27 -04:00
Charlie Marsh de53b567f5
Add a list of projects using Ruff (#608) 2022-11-05 16:03:10 -04:00
Charlie Marsh 2e1799dd80
Automatically update README.md from generate_rules_table.rs (#606) 2022-11-05 15:33:47 -04:00
Charlie Marsh b335a6a5ec Bump version to 0.0.102 2022-11-05 14:13:02 -04:00
Charlie Marsh f5cbee452a Increase flake8-bugbear count to 15/32 2022-11-05 14:12:35 -04:00
Harutaka Kawamura 62c126f70e
Implement B003 (#596) 2022-11-05 14:08:02 -04:00
Harutaka Kawamura 8344d5151c
Implement B016 (#595) 2022-11-05 14:06:00 -04:00
Harutaka Kawamura f7780eb720
Implement B008 (#594) 2022-11-05 14:05:04 -04:00
Charlie Marsh fbdc075e5c
Change Ruff's error prefix to RUF (#592) 2022-11-04 23:13:50 -04:00
Charlie Marsh d3472104d0 Bump flake8-bugbear count to 12/32 2022-11-04 14:49:14 -04:00
Charlie Marsh 0c8b981216 Bump version to 0.0.101 2022-11-04 14:46:48 -04:00
Charlie Marsh 0e3f08aa68
Split ambiguous unicode detection into string vs. docstring rules (#590) 2022-11-04 14:46:20 -04:00
Harutaka Kawamura 726e6c68cf
Implement B015 (#587) 2022-11-04 13:47:52 -04:00
Charlie Marsh 34c91224d7 Bump version to 0.0.100 2022-11-04 12:10:17 -04:00
Charlie Marsh 50c4bbc52b
Implement ambiguous unicode character detection (#578) 2022-11-04 12:08:26 -04:00
Charlie Marsh c92f5c14a3
Bump Rust version to 1.65.0 (#575) 2022-11-03 22:49:21 -04:00
Charlie Marsh cc915371ca
Implement autofix for F901 (#571) 2022-11-03 11:58:54 -04:00
Charlie Marsh 5576db3d5a Bump version to 0.0.99 2022-11-03 11:47:15 -04:00
Charlie Marsh f26f38d023
Enable autofix for C406 (#570) 2022-11-03 11:27:46 -04:00
Charlie Marsh 578ec4d843
Implement autofix for C416 (#568) 2022-11-03 11:05:08 -04:00
Charlie Marsh 22991e3e0e Bump version to 0.0.98 2022-11-03 10:09:33 -04:00
Charlie Marsh 9f9cbb5520 Improve pyproject.toml examples in README.md 2022-11-03 09:33:17 -04:00
Charlie Marsh e00bcd19f5 Bump version to 0.0.97 2022-11-02 22:38:43 -04:00
Charlie Marsh e473df1fe9 Bump version to 0.0.96 2022-11-02 22:10:56 -04:00
Charlie Marsh 6a180b95d1
Implement autofix for dict and tuple comprehensions (#555) 2022-11-02 21:36:20 -04:00
Charlie Marsh 9948be0145
Automatically fix a variety of comprehension rules (#553) 2022-11-02 20:39:35 -04:00
Charlie Marsh f9def0a139 Bump version to 0.0.95 2022-11-02 09:03:34 -04:00
StefanBRas d4fc485a76
Update README.md to use table for per-file-ignore (#549) 2022-11-02 09:02:11 -04:00
Charlie Marsh 878a94f9cb
Add a rust-toolchain.toml file (#538) 2022-11-01 20:34:58 -04:00
Charlie Marsh 79ca66ace5
Use nightly rustfmt with rustfmt.toml (#536) 2022-11-01 20:34:38 -04:00
Charlie Marsh 2d83f99dbf Bump version to 0.0.94 2022-11-01 16:38:59 -04:00
Charlie Marsh 062c41b6f5 Bump version to 0.0.93 2022-10-31 09:20:39 -04:00
Charlie Marsh 138b06c98a Bump version to 0.0.92 2022-10-30 18:04:30 -04:00
Charlie Marsh dcedb801e5
Tweak a few check messages (#520) 2022-10-30 13:13:37 -04:00
Charlie Marsh dfa5a4f0f7 Fix 9/32 flake8-bugbear reference 2022-10-30 13:03:39 -04:00
Harutaka Kawamura 7ecbfe4f6a
Implement B006 (#515) 2022-10-30 12:57:57 -04:00
Charlie Marsh f84c1f1fa1 Bump version to 0.0.91 2022-10-29 18:49:26 -04:00
Charlie Marsh 5a3f06bab1 Bump version to 0.0.90 2022-10-29 18:34:38 -04:00
Anders Kaseorg fa9b10be72
Remove leading space from C416 message (#508) 2022-10-29 17:40:50 -04:00
Charlie Marsh 80b00cc89f
Add error code categories to table of contents (#504) 2022-10-29 16:39:55 -04:00
Charlie Marsh 934db3d179 Bump version to 0.0.89 2022-10-29 15:39:17 -04:00
Charlie Marsh 6a040a0405 Update checks_gen.rs 2022-10-29 15:39:02 -04:00
Harutaka Kawamura 2821ef0f69
Implement B013 (#503) 2022-10-29 15:36:29 -04:00
Harutaka Kawamura 3fc257f71b
Implement N806, 815, 816, 818 (#501) 2022-10-29 15:35:56 -04:00
Charlie Marsh 6dbb0a17e9 Update README to reflect selection groups 2022-10-28 19:15:46 -04:00
Charlie Marsh ae5ad6a4ac Bump version to 0.0.88 2022-10-28 19:11:04 -04:00
Charlie Marsh 9a799eb4e6 Bump version to 0.0.87 2022-10-28 19:00:03 -04:00
Charlie Marsh 86265c1d7c
Implement the `flake8-quotes` plugin (#495) 2022-10-28 17:52:11 -04:00
Trevor Gross 2e63bb6dcb
Update hook id in README and in .pre-commit-config.yaml (#492) 2022-10-27 17:32:52 -04:00
Charlie Marsh 1b5db80b32 Update pre-commit invocation in README.md 2022-10-27 17:19:22 -04:00
Charlie Marsh 3f20cea402 Bump version to 0.0.86 2022-10-27 13:09:57 -04:00
Charlie Marsh bad2d7ba85
Add example of per-file ignores to the README (#488) 2022-10-27 12:58:52 -04:00