Description
Followup to #10742
We use Ruff to enforce docsting style
|
extend-select = [ |
|
"I", # Missing required import (auto-fixable) |
|
"UP", # Pyupgrade |
|
"RUF100", # Unused noqa (auto-fixable) |
|
|
|
# implicit single-line string concatenation |
|
"ISC001", |
|
# We ignore more pydocstyle than we enable, so be more selective at what we enable |
|
"D101", |
|
"D106", |
|
"D2", |
|
"D3", |
|
"D400", |
|
# "D401", # Not enabled by ruff, but we don't want it |
|
"D402", |
|
"D403", |
|
"D412", |
|
"D419" |
|
] |
|
extend-ignore = [ |
|
"D203", |
|
"D205", |
|
"D212", |
|
"D213", |
|
"D214", |
|
"D215", |
|
"E731", |
|
] |
We follow pep257 style (http://www.pydocstyle.org/en/stable/error_codes.html) for checks.
Currently, we ignore the following rules and should work towards enabling them:
Missing Docstrings
It would be good if we can enable them one by one -- separate PRs are ok
Rough process to fix these
-
Set up your dev environment [docs]
0.5. Go to your airflow directory and run ruff check. Write down the number of failures. Mine currently says 8. This step is just to make sure it's working and give you a baseline.
-
Open /airflow/pyproject.toml
-
In the ignore list (currently starting on line 301) comment out the rule you intend to work on
-
In a terminal, go to the airflow directory and run ruff check again. It should now fail with WAY more errors. Mine currently says 863. If the number didn't go way up, something is wrong with your setup.
-
Have a quick scroll through that list, paying attention to which ones failed because of the rule you just enabled.
-
Come up with a rough plan to break that down into bites. Maybe pick one directory that has a bunch of failures and start fixing there.
-
After you have a handful of fixes done: remove your comment (so it is ignored again) and submit a PR with that chunk of changes (see the Contributing docs in step 0)
PLEASE submit these in many small PRs. If you do it all at once it will turn into a 3000-line PR and nobody will review it. Eventually, on the last chunk you'll just remove that line from the ignore list entirely when there are no more violations to fix.
Let me know if you need any help, or ask in the Slack server.
Description
Followup to #10742
We use Ruff to enforce docsting style
airflow/pyproject.toml
Lines 47 to 74 in 23b8e83
We follow pep257 style (http://www.pydocstyle.org/en/stable/error_codes.html) for checks.
Currently, we ignore the following rules and should work towards enabling them:
Missing Docstrings
__init__https://lists.apache.org/thread/lcvocwxnrrzq9ofrg4b4hj0yvpzbnygfIt would be good if we can enable them one by one -- separate PRs are ok
Rough process to fix these
Set up your dev environment [docs]
0.5. Go to your
airflowdirectory and runruff check. Write down the number of failures. Mine currently says 8. This step is just to make sure it's working and give you a baseline.Open
/airflow/pyproject.tomlIn the
ignorelist (currently starting on line 301) comment out the rule you intend to work onIn a terminal, go to the
airflowdirectory and runruff checkagain. It should now fail with WAY more errors. Mine currently says 863. If the number didn't go way up, something is wrong with your setup.Have a quick scroll through that list, paying attention to which ones failed because of the rule you just enabled.
Come up with a rough plan to break that down into bites. Maybe pick one directory that has a bunch of failures and start fixing there.
After you have a handful of fixes done: remove your comment (so it is ignored again) and submit a PR with that chunk of changes (see the Contributing docs in step 0)
PLEASE submit these in many small PRs. If you do it all at once it will turn into a 3000-line PR and nobody will review it. Eventually, on the last chunk you'll just remove that line from the ignore list entirely when there are no more violations to fix.
Let me know if you need any help, or ask in the Slack server.