-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-127443: add tool for linting Doc/data/refcounts.dat
#127476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
picnixz
wants to merge
32
commits into
python:main
Choose a base branch
from
picnixz:tools/refcounts/lint-127443
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+587
−3
Draft
Changes from 21 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
183388f
Add tool for linting `Doc/data/refcounts.dat`
picnixz 9c2a109
use single-quotes
picnixz 6c1a19e
add default paths
picnixz 419197b
use NamedTuple whenever possible
picnixz 58ffbeb
address Peter's review
picnixz 9a46f10
fix typos
picnixz 8372de6
address Alex's review
picnixz 4bcf719
format using a mix of black/ruff/picnixz format
picnixz 841a4b1
rename STEALS -> STEAL
picnixz 970cbc7
detect more ref. count manageable objects
picnixz 4558483
add `lineno` to RETURN values and use kw-only
picnixz b8f6090
use helper for C identifier detection
picnixz db9b6e6
`RefType` -> `RefEffect`
picnixz 480f500
improve `ParserReporter`
picnixz 9814dd7
disallow stolen ref in return values
picnixz 82766b3
add doc
picnixz e7a7a10
fix workflow
picnixz f64a23d
update pre-commit hook
picnixz 2eb541f
fix some typos
picnixz cf42e03
restrict the ruff rules
picnixz eb893d0
add ruff docstrings rules
picnixz dbe29a6
address Peter's review
picnixz 658e332
update some variable names
picnixz 5660ffe
add TODO messages
picnixz afceff0
RefEffect -> Effect
picnixz d173d7a
extract checking logic into smaller functions
picnixz 0edd489
add --strict errors mode
picnixz a3becf0
additional stealing effects
picnixz 3ac1ff1
Merge remote-tracking branch 'upstream/main' into tools/refcounts/lin…
picnixz baf2474
address Hugo's review
picnixz 549ba49
remove TODO symbols for now (we don't want yet to change the Sphinx e…
picnixz c708a4c
address Alex's review
picnixz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
target-version = "py312" | ||
line-length = 79 | ||
fix = true | ||
preview = true | ||
|
||
[lint] | ||
select = [ | ||
"I", # isort | ||
"D204", # 1 blank line required after class docstring | ||
"D205", # 1 blank line required between summary line and description | ||
"D400", # First line should end with a period | ||
"D401", # First line of docstring should be in imperative mood | ||
"F", # Enable all pyflakes rules | ||
"E", # Enable all pycodestyle error rules | ||
"W", # Enable all pycodestyle warning rules | ||
"UP", # Enable all pyupgrade rules | ||
"RUF100", # Ban unused `# noqa` comments | ||
"PGH003", # Use specific rule codes when ignoring type issues | ||
"PGH004", # Use specific rule codes when using noqa | ||
"C4", # flake8-comprehensions | ||
"ISC", # flake8-implicit-str-concat | ||
"TCH", # flake8-type-checking | ||
"PTH", # flake8-use-pathlib | ||
"PERF101", # unnecessary-list-cast | ||
"PERF102", # incorrect-dict-iterator | ||
"PERF401", # manual-list-comprehension | ||
"PERF402", # manual-list-copy | ||
"PERF403", # manual-dict-comprehension | ||
"FURB101", # read-whole-file | ||
"FURB103", # write-whole-file | ||
"FURB110", # if-exp-instead-of-operator | ||
"FURB113", # repeated-append | ||
"FURB116", # f-string-number-format | ||
"FURB129", # readlines-in-for | ||
"FURB132", # check-and-remove-from-set | ||
"FURB136", # if-expr-min-max | ||
"FURB142", # for-loop-set-mutations | ||
"FURB167", # regex-flag-alias | ||
"FURB177", # implicit-cwd | ||
] | ||
|
||
[lint.pycodestyle] | ||
max-doc-length = 79 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.