Commit Graph

264 Commits

Author SHA1 Message Date
Charlie Marsh b049cced04
Automatically remove unused imports (#298) 2022-10-03 14:08:16 -04:00
Charlie Marsh bc335f839e
Visit lambda arguments prior to deferral (#303) 2022-10-02 20:54:02 -04:00
Charlie Marsh 622b8adb79
Avoid falling back to A003 when A001 is disabled (#302) 2022-10-02 20:43:12 -04:00
Charlie Marsh 558d9fcbe3
Enable LibCST-based autofixing for SPR001 (#297) 2022-10-02 19:58:13 -04:00
Charlie Marsh 83f18193c2
Add an end location to Check (#299) 2022-10-02 12:50:42 -04:00
Charlie Marsh 46e6a1b3be
Add end locations to all nodes (#296) 2022-10-02 12:49:48 -04:00
Suguru Yamamoto 4d0d433af9
fix: Make assigns to dunder exception for E402. (#294) 2022-10-01 09:43:47 -04:00
Charlie Marsh 417764d309
Expose a public 'check' method (#289) 2022-09-30 11:30:37 -04:00
Charlie Marsh 75d669fa86 Update check ordering 2022-09-30 09:14:41 -04:00
Nikita Sobolev 20989e12ba
Implement `flake8-super` check (#291) 2022-09-30 09:12:09 -04:00
Charlie Marsh ca6551eb37 Remove misc. unnecessary statements 2022-09-29 18:45:10 -04:00
Nikita Sobolev 63ba0bfeef
Adds flake8-builtins (#284) 2022-09-29 16:37:43 -04:00
Anders Kaseorg 91666fcaf6
Don’t follow directory symlinks found while walking (#280) 2022-09-29 15:10:25 -04:00
Charlie Marsh 7f84753f3c Improve rendering of --show-settings 2022-09-28 22:30:20 -04:00
Charlie Marsh e2ec62cf33
Misc. follow-up changes to #272 (#278) 2022-09-28 22:15:58 -04:00
Charlie Marsh 1d5592d937
Use take-while to terminate on parse errors (#279) 2022-09-28 22:06:35 -04:00
Anders Kaseorg 886def13bd
Upgrade to clap 4 (#272) 2022-09-28 17:11:57 -04:00
Seamooo 02ae494a0e
Enable per-file ignores (#261) 2022-09-24 13:02:34 -04:00
Harutaka Kawamura dce86e065b
Make unused variable pattern configurable (#265) 2022-09-24 10:43:39 -04:00
Harutaka Kawamura d77979429c
Print warning and error messages in stderr (#267) 2022-09-24 09:27:35 -04:00
Adrian Garcia Badaracco a3a15d2eb2
error invalid pyproject.toml configs (#264) 2022-09-23 21:16:07 -04:00
Charlie Marsh 5af95428ff Tweak import 2022-09-23 18:53:57 -04:00
Harutaka Kawamura 485881877f
Include error code and message in JSON output (#259) 2022-09-22 20:29:21 -04:00
Charlie Marsh c0ce0b0c48
Enable automatic `noqa` insertion (#256) 2022-09-22 13:59:06 -04:00
Charlie Marsh e5b16973a9
Enable autofix for M001 (#255) 2022-09-22 13:21:03 -04:00
Charlie Marsh de9ceb2fe1
Only enforce multi-line noqa directives for strings (#258) 2022-09-22 13:09:02 -04:00
Charlie Marsh 38b19b78b7
Enable noqa directives on logical lines (#257) 2022-09-22 12:56:15 -04:00
Charlie Marsh 7043e15b57 Move noqa to a separate module 2022-09-22 09:04:54 -04:00
Charlie Marsh 9594079235
Add --extend-select and --extend-ignore (#254) 2022-09-21 19:56:43 -04:00
Charlie Marsh 732f208e47
Add a lint rule to enforce noqa validity (#253) 2022-09-21 19:56:38 -04:00
Charlie Marsh d9e4b0cdc1
Implement --show-settings and --show-files (#246) 2022-09-21 15:08:50 -04:00
Charlie Marsh 36fcfad56a Remove empty comment 2022-09-21 13:44:49 -04:00
Charlie Marsh 65d29d9734
Adjust line numbers when reporting rules in f-strings (#244) 2022-09-21 13:42:58 -04:00
Charlie Marsh 2bdc500c61 Re-run cargo insta 2022-09-21 12:24:46 -04:00
Charlie Marsh d827e6e36a
Implement F405 (#243) 2022-09-21 12:13:40 -04:00
Harutaka Kawamura 71d9b2ac5f
Implement F402 (#221) 2022-09-21 11:12:55 -04:00
Anders Kaseorg 401b53cc45
Handle filesystem errors more consistently (#240) 2022-09-20 23:22:01 -04:00
Anders Kaseorg aa9c1e255c
Simplify check_path type (#239) 2022-09-20 21:11:42 -04:00
Anders Kaseorg f7fc702b2c
Include specified files, even if they lack a .py[i] extension (#238) 2022-09-20 20:53:52 -04:00
Anders Kaseorg 50ca0d7d0a
Correctly display the location of parse errors (#237) 2022-09-20 20:53:22 -04:00
Anders Kaseorg 65e0284698
Suppress “Found 0 error(s)” message (#236) 2022-09-20 19:32:39 -04:00
Charlie Marsh 4ed88dd245
Follow-up fixes to path absolution (#235) 2022-09-20 12:26:32 -04:00
Charlie Marsh 09b926fd59 Optimize imports 2022-09-20 09:10:39 -04:00
Charlie Marsh fa0954fe47
Treat relative excludes as relative to project root (#228) 2022-09-19 20:45:02 -06:00
Charlie Marsh a0b50d7ebc
Use absolute paths for exclusion matching (#213) 2022-09-19 20:32:31 -06:00
Charlie Marsh afe7a04211
Ignore F841 violations when locals() is in scope (#226) 2022-09-19 20:13:55 -06:00
Charlie Marsh 14806c62ca
Reduce number of sites for new check definitions (#227) 2022-09-19 20:13:46 -06:00
Suguru Yamamoto 0d0c8730fa
fix: Use UTF-32 char count for line length (#223) (#224) 2022-09-18 10:45:41 -06:00
Harutaka Kawamura cf6a23b83c
Add `--version` flag (#222) 2022-09-18 09:15:15 -06:00
Anders Kaseorg 9e0daac561
Enable F404 by default (#219) 2022-09-18 09:13:23 -06:00
Anders Kaseorg f2fd7335ce
Use a platform-appropriate location for user configuration (#215) 2022-09-17 13:29:17 -06:00
Anders Kaseorg b8f878df5e
Find user configuration even if there’s no project directory (#216) 2022-09-16 21:47:15 -06:00
Anders Kaseorg 9bdb922c75
Detect multi-target assignment as unpacking if *any* target is unpacking (#217) 2022-09-16 21:45:44 -06:00
Anders Kaseorg edecc1bba6
Fix find_project_root with relative paths (#214) 2022-09-16 18:04:35 -06:00
Charlie Marsh 24de97d951 Create cache directory prior to writing .gitignore 2022-09-16 04:56:58 -04:00
Charlie Marsh 9d4a4478f7
Improve exclusion syntax to match exact files (#209) 2022-09-15 21:40:49 -04:00
Charlie Marsh 6bbf3f46c4
Add .gitignore to .ruff_cache (#208) 2022-09-15 20:40:06 -04:00
Charlie Marsh 4ac4e8c991
Exclude .ruff_cache by default (#207) 2022-09-15 20:39:39 -04:00
Dmitry Dygalo 0091a3ae5f
chore: Do not read the same file twice (#206) 2022-09-15 16:05:29 -04:00
Charlie Marsh 71520213c1
Allow __path__ in __init__.py (#201) 2022-09-15 09:44:03 -04:00
Charlie Marsh f24e7a0052 Add trailing period to help message 2022-09-15 09:43:51 -04:00
Patrick Haller 507e9f7ec3
Fix: Structured output Issue Fix (#186) 2022-09-15 09:43:10 -04:00
Charlie Marsh 592c53c8bf
Use binding location when reporting F821 errors (#200) 2022-09-14 22:51:07 -04:00
Charlie Marsh b8f12d2e79
Raise error when failing to parse (#199) 2022-09-14 22:37:55 -04:00
Charlie Marsh 67b1d0463a
Pull in pycodestyle tests for E checks (#195) 2022-09-14 22:22:53 -04:00
Charlie Marsh d008a181ec
Improve default exclusions and support extend-exclude (#188) 2022-09-14 22:21:17 -04:00
Charlie Marsh 6d612a428a
Migrate linter tests to insta (#194) 2022-09-14 21:52:44 -04:00
Charlie Marsh c0cb73ab16
Implement E721 (#193) 2022-09-14 21:10:29 -04:00
Charlie Marsh 2e1eb84cbf
Implement F632 (#190) 2022-09-14 18:22:35 -04:00
Charlie Marsh b03a8728b5
Add support for from __future__ import annotations (#189) 2022-09-14 18:22:19 -04:00
Charlie Marsh 1dd3350a30
Revert "Adding flag and logic for different output format" (#187) 2022-09-14 14:20:02 -04:00
Patrick Haller bda34945a5
Adding flag and logic for different output format (#185) 2022-09-14 10:43:32 -04:00
Dmitry Dygalo 85dcaa8d3c
chore: Avoid `collect` in `inner_main` (#184) 2022-09-14 08:16:04 -04:00
Dmitry Dygalo b7e2a4b9a9
feat: Implement `InvalidPrintSyntax` (`F633`) (#182) 2022-09-13 21:10:20 -04:00
Dmitry Dygalo 53a7758248
Avoid some allocations (#179) 2022-09-13 10:07:22 -04:00
Dmitry Dygalo 2ba767957d
refactor: Use `while let Some` instead of calling `is_empty` (#180) 2022-09-13 10:06:49 -04:00
Dmitry Dygalo 08152787e1
chore: Use `once_cell` instead of `lazy_static` (#178) 2022-09-13 10:06:21 -04:00
Charlie Marsh 90f9e60517
Implement F722 (#175) 2022-09-12 21:34:27 -04:00
Charlie Marsh dfba1416b2
Implement F406 (#172) 2022-09-12 16:47:30 -04:00
Charlie Marsh 2ca3f35bd1 Remove one match from checks.rs 2022-09-12 16:32:27 -04:00
Charlie Marsh 40c1e7e005
Implement F701 and F702 (#169) 2022-09-12 11:16:08 -04:00
Harutaka Kawamura 9414090617
Implement E722 (#166) 2022-09-12 09:04:39 -04:00
Harutaka Kawamura 825777edc1
Add test case for assignment expression in `E741.py` (#168) 2022-09-12 09:03:36 -04:00
Charlie Marsh 4e0807e908
Include line length in E501 messages (#165) 2022-09-11 22:54:11 -04:00
Charlie Marsh 43e1f20b28
Allow unused assignments in for loops and unpacking (#163) 2022-09-11 21:53:45 -04:00
Harutaka Kawamura 97388cefda
Implement E743 (#162) 2022-09-11 21:27:33 -04:00
Harutaka Kawamura 63ce579989
Implement E742 (#160) 2022-09-11 20:27:48 -04:00
Charlie Marsh 02ab52b3e2
Implement F407 (#158) 2022-09-11 18:05:28 -04:00
Charlie Marsh 549732b1da
Implement F404 (#159) 2022-09-11 18:05:00 -04:00
Harutaka Kawamura c4565fe0f5
Implement E741 (#137) 2022-09-11 12:30:28 -04:00
Charlie Marsh 62e6feadc7
Handle accesses within inner functions (#156) 2022-09-11 10:44:27 -04:00
Charlie Marsh 18a26e8f0b
Allow setting --exclude on the command-line (#157) 2022-09-11 10:44:23 -04:00
Charlie Marsh 2371de3895
Make late imports more permissive (#155) 2022-09-11 10:44:06 -04:00
Charlie Marsh e3c8f61340
Ignore deletes in conditional branches (#154) 2022-09-11 10:28:07 -04:00
Harutaka Kawamura f6628ae100
Fix `Message.cmp` (#152) 2022-09-11 10:18:27 -04:00
Charlie Marsh dfd8a4158d
Parse function annotations within the ClassDef scope (#144) 2022-09-10 15:20:39 -04:00
Charlie Marsh c247730bf5 Avoid treating keys as annotations in TypedDict 2022-09-10 15:19:11 -04:00
Charlie Marsh 024472d578
Implement F621 and F622 (#143) 2022-09-10 15:04:33 -04:00
Charlie Marsh 7d69a153e8
Support remaining typing module members (#141) 2022-09-10 14:51:43 -04:00
Charlie Marsh 6a24351202 Add support for TypedDict 2022-09-10 13:03:29 -04:00