-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/charliermarsh/ruff/ is a faster replacement of most of the linting tools we use, and is starting to picked up by several other projects. Even project like Pandas have adopted Ruff (pandas-dev/pandas#50160) This PR replaces flake8, isort, pyupgrade. ``` ❯ time pre-commit run flake8 --all-files flake8...................................................................Passed pre-commit run flake8 --all-files 3.48s user 0.55s system 372% cpu 1.084 total ❯ time pre-commit run isort --all-files Run isort................................................................Passed pre-commit run isort --all-files 0.31s user 0.18s system 50% cpu 0.973 total ❯ time pre-commit run pyupgrade --all-files pyupgrade................................................................Passed pre-commit run pyupgrade --all-files 1.26s user 0.23s system 280% cpu 0.530 total ``` vs ``` ❯ time pre-commit run ruff --all-files ruff.....................................................................Passed pre-commit run ruff --all-files 0.37s user 0.16s system 142% cpu 0.373 total ``` **_Drops from 5s to 0.3s_** Some other popular tools that have adopted it: - [FastAPI](https://github.com/tiangolo/fastapi) - [Bokeh](https://github.com/bokeh/bokeh) - [Zulip](https://github.com/zulip/zulip) - [Pydantic](https://github.com/pydantic/pydantic) - [Sphinx](https://github.com/sphinx-doc/sphinx) - [Hatch](https://github.com/pypa/hatch) - [Jupyter](https://github.com/jupyter-server/jupyter_server) - [Synapse](https://github.com/matrix-org/synapse) - [Saleor](https://github.com/saleor/saleor) - [Polars](https://github.com/pola-rs/polars) - [Ibis](https://github.com/ibis-project/ibis) - [OpenBB](https://github.com/OpenBB-finance/OpenBBTerminal) It will also be used by Apache Airflow :) and should be used in Astronomer-providers too.
- Loading branch information
Showing
13 changed files
with
58 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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 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 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 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 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,38 @@ | ||
line-length = 120 | ||
|
||
# Enable Pyflakes `E` and `F` codes by default. | ||
extend-select = [ | ||
"W", # pycodestyle warnings | ||
"I", # isort | ||
"C90", # Complexity | ||
# "B", # flake8-bugbear | ||
"C", # flake8-comprehensions | ||
# "ANN", # flake8-comprehensions | ||
"ISC", # flake8-implicit-str-concat | ||
"T10", # flake8-debugger | ||
"A", # flake8-builtins | ||
"UP", # pyupgrade | ||
] | ||
extend-ignore = ["A002"] | ||
|
||
# Exclude a variety of commonly ignored directories. | ||
extend-exclude = [ | ||
"__pycache__", | ||
"docs/source/conf.py", | ||
] | ||
|
||
target-version = "py37" | ||
fix = true | ||
|
||
[per-file-ignores] | ||
"python-sdk/src/astro/sql/__init__.py" = ["F401"] | ||
"python-sdk/src/astro/lineage/__init__.py" = ["F401"] | ||
"python-sdk/src/astro/sql/table.py" = ["F401"] | ||
|
||
|
||
[mccabe] | ||
max-complexity = 6 | ||
|
||
[isort] | ||
combine-as-imports = true | ||
known-first-party = ["astro", "tests", "sql_cli"] |