Charlie Marsh
06e426f509
Bump version to 0.0.250 ( #3095 )
2023-02-21 15:20:46 -05:00
Carlos Gonçalves
6eb014b3b2
feat(B032): add b032 flake8_bugbear ( #3085 )
2023-02-21 19:53:29 +00:00
Charlie Marsh
d9fd78d907
Ignore setters in flake8-boolean-trap ( #3092 )
2023-02-21 19:31:00 +00:00
Charlie Marsh
d5c65b5f1b
Add support for structural pattern matching ( #3047 )
2023-02-21 18:52:10 +00:00
Charlie Marsh
cdc4e86158
Add support for TryStar ( #3089 )
2023-02-21 13:42:20 -05:00
Charlie Marsh
50ec6d3b0f
Use LibCST to fix chained assertions ( #3087 )
2023-02-21 13:10:31 -05:00
Charlie Marsh
a6eb60cdd5
Enable function2 test ( #3083 )
2023-02-21 04:37:50 +00:00
Charlie Marsh
90c04b9cff
Enable tupleassign test ( #3080 )
2023-02-21 00:42:23 +00:00
Charlie Marsh
b701cca779
Enable some already-passing Black tests ( #3079 )
2023-02-21 00:10:35 +00:00
Charlie Marsh
ce8953442d
Add support for trailing colons in slice expressions ( #3077 )
2023-02-20 23:24:32 +00:00
Charlie Marsh
7d4e513a82
Omit while-True loops from implicit return enforcement ( #3076 )
2023-02-20 18:22:28 -05:00
Charlie Marsh
35f7f7b66d
Avoid boolean-trap rules for positional-only builtin calls ( #3075 )
2023-02-20 23:08:18 +00:00
Charlie Marsh
6e02405bd6
Add StmtKind::Try; fix trailing newlines ( #3074 )
2023-02-20 22:55:32 +00:00
Carlos Gonçalves
b657468346
feat(B029): Add B029 from flake8-bugbear ( #3068 )
2023-02-20 15:57:13 -05:00
Micha Reiser
f72ed255e5
chore: Use LF on all platforms ( #3005 )
...
I worked on #2993 and ran into issues that the formatter tests are failing on Windows because `writeln!` emits `\n` as line terminator on all platforms, but `git` on Windows converted the line endings in the snapshots to `\r\n`.
I then tried to replicate the issue on my Windows machine and was surprised that all linter snapshot tests are failing on my machine. I figured out after some time that it is due to my global git config keeping the input line endings rather than converting to `\r\n`.
Luckily, I've been made aware of #2033 which introduced an "override" for the `assert_yaml_snapshot` macro that normalizes new lines, by splitting the formatted string using the platform-specific newline character. This is a clever approach and gives nice diffs for multiline fixes but makes assumptions about the setup contributors use and requires special care whenever we use line endings inside of tests.
I recommend that we remove the special new line handling and use `.gitattributes` to enforce the use of `LF` on all platforms [guide](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings ). This gives us platform agnostic tests without having to worry about line endings in our tests or different git configurations.
## Note
It may be necessary for Windows contributors to run the following command to update the line endings of their files
```bash
git rm --cached -r .
git reset --hard
```
2023-02-20 20:13:37 +00:00
Colin Delahunty
9545958ad8
[flake8-simplify]: Implement manual-dict-lookup ( #2767 )
2023-02-20 20:00:59 +00:00
Colin Delahunty
41faa335d1
[tryceratops]: Verbose Log Messages ( #3036 )
2023-02-20 18:21:04 +00:00
Charlie Marsh
4cfa350112
Bump version to 0.0.249 ( #3063 )
2023-02-20 13:11:29 -05:00
Charlie Marsh
41f163fc8d
Avoid assert() to assert statement conversion in expressions ( #3062 )
2023-02-20 17:49:22 +00:00
Charlie Marsh
d21dd994e6
Increase expected size of FormatElement ( #3049 )
2023-02-20 12:47:35 -05:00
Josh Karpel
6f5a6b8c8b
Do not autofix E731 in class bodies ( #3050 )
2023-02-20 12:38:42 -05:00
Jeong YunWon
35606d7b05
clean up to fix nightly clippy warnings and dedents ( #3057 )
2023-02-20 09:33:47 -05:00
Charlie Marsh
b39f960cd1
Relax constraints on pep8-naming module validation ( #3043 )
2023-02-19 17:34:23 -05:00
Charlie Marsh
c297d46899
Remove unused AsFormat trait for Option<T> ( #3041 )
...
We should re-add this, but it's currently unused and doesn't compile under 1.66.0.
See: #3039 .
2023-02-19 20:19:35 +00:00
Jonathan Plasse
d6a100028c
Update docs and pre-commit after #3006 ( #3038 )
2023-02-19 14:23:01 -05:00
Jonathan Plasse
35d4e03f2a
Fix ruff_dev regex workspace dependency ( #3037 )
2023-02-19 18:02:08 +00:00
Charlie Marsh
2ff3dd5fbe
Bump version to 0.0.248 ( #3034 )
2023-02-19 16:21:30 +00:00
Charlie Marsh
0f0e7a521a
Avoid false-positives for break in with ( #3032 )
2023-02-19 11:17:04 -05:00
Jonathan Plasse
b75663be6d
Add missing rust-version in crates ( #3009 )
2023-02-19 15:07:17 +00:00
Tomer Chachamu
4d3d04ee61
[PLE0101] error when __init__ returns a value ( #3007 )
2023-02-19 14:54:43 +00:00
Manuel Jacob
87422ba362
Add configuration option for C408 to allow dict calls with keyword arguments. ( #2977 )
...
When creating a dict with string keys, some prefer to call dict instead of writing a dict literal.
For example: `dict(a=1, b=2, c=3)` instead of `{"a": 1, "b": 2, "c": 3}`.
2023-02-19 14:47:03 +00:00
Jeremy Goh
c1d2976fff
[docs] Add docs for flake8-implicit-str-concat rules ( #3028 )
2023-02-19 14:38:59 +00:00
Jeremy Goh
13281cd9ca
[docs] Add some docs for flake8-simplify ( #3027 )
2023-02-19 14:26:56 +00:00
Jonathan Plasse
e53652779d
Avoid raising B027 violations in .pyi files ( #3016 )
2023-02-19 14:21:33 +00:00
Nyakku Shigure
216aa929af
Remove duplicate underline in B007 autofix message ( #3021 )
2023-02-18 19:38:20 -05:00
Simon Brugman
9e45424ed6
[pycodestyle] autofix useless semicolons ( #3001 )
2023-02-17 18:52:42 -05:00
Charlie Marsh
db7f16e276
Support positional messages in assertion rewrites ( #3002 )
2023-02-17 23:44:13 +00:00
Charlie Marsh
a10a500a26
Ignore namedtuple methods in flake8-self ( #2998 )
2023-02-17 17:16:25 -05:00
Simon Brugman
a934d01bdb
[flake8-tidy-imports] extend autofix of relative imports ( #2990 )
...
This extends the autofix for TID252 to work with for relative imports without `module` (i.e. `from .. import`). Tested with `matplotlib` and `bokeh`.
(Previously it would panic on unwrap of the module)
Note that pandas has [replaced](6057d7a93e ) `absolufy-imports` with `ruff` now!
2023-02-17 19:35:28 +00:00
Simon Brugman
0dd590f137
Fix for F541 unescape f-string ( #2971 )
2023-02-17 14:27:01 -05:00
Charlie Marsh
909a5c3253
Avoid zero-indexed column for IOError ( #2995 )
2023-02-17 14:14:28 -05:00
Charlie Marsh
5c987874c4
Enforce D403 on methods ( #2992 )
2023-02-17 18:05:48 +00:00
Nyakku Shigure
0cfe4f9c69
Remove a whitespace in B004 message ( #2991 )
2023-02-17 12:37:08 -05:00
Martin Fischer
d658bfc024
Remove options from README
2023-02-17 07:55:50 -05:00
Martin Fischer
b0d72c47b4
refactor: Move Top-level heading into ruff_dev
2023-02-17 07:55:50 -05:00
Martin Fischer
8195873cdf
Remove rule tables from README
2023-02-17 07:55:50 -05:00
Martin Fischer
bf8108469f
Remove auto-generated table of contents
2023-02-17 07:55:50 -05:00
Martin Fischer
a2277cfeba
refactor: Move fix symbol legend into ruff_dev
2023-02-17 07:55:50 -05:00
Charlie Marsh
180541a924
Unify comment terminology with that of rome_formatter ( #2979 )
2023-02-17 03:02:25 +00:00
Simon Brugman
34664a0ca0
[numpy] numpy-legacy-random ( #2960 )
...
The new `Generator` in NumPy uses bits provided by [PCG64](https://numpy.org/doc/stable/reference/random/bit_generators/pcg64.html#numpy.random.PCG64 ) which has better statistical properties than the legacy [MT19937](https://numpy.org/doc/stable/reference/random/bit_generators/mt19937.html#numpy.random.MT19937 ) used in [RandomState](https://numpy.org/doc/stable/reference/random/legacy.html#numpy.random.RandomState ). Global random functions can also be problematic with parallel processing.
This rule is probably quite useful for data scientists (perhaps in combination with `nbqa`)
References:
- [Legacy Random Generation](https://numpy.org/doc/stable/reference/random/legacy.html#legacy )
- [Random Sampling](https://numpy.org/doc/stable/reference/random/index.html#random-quick-start )
- [Using PyTorch + NumPy? You're making a mistake.](https://tanelp.github.io/posts/a-bug-that-plagues-thousands-of-open-source-ml-projects/ )
2023-02-17 02:06:30 +00:00