Skip to content
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

[chore] unify local and pre-commit ruff configuration #23501

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 29 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
default_stages: [pre-commit] # don't run on push by default
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.5.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
types_or: [python, pyi, jupyter]
- id: ruff-format
- repo: local
hooks:
- id: docs-mdx-format
name: Format Docs
language: system
entry: bash -c "cd docs && make mdx-format"
pass_filenames: false
files: ^docs/content
- id: ruff-format
name: Ruff Format
entry: ruff
args: [format]
language: system
pass_filenames: false
- id: ruff-lint
name: Ruff Lint
entry: ruff
args: [check, --fix, --exit-non-zero-on-fix]
language: system
pass_filenames: false
- id: docs-mdx-format
name: Format Docs
language: system
entry: bash -c "cd docs && make mdx-format"
pass_filenames: false
files: ^docs/content

# We do not use pyright's provided pre-commit hook because we need the environment management
# supplied by `scripts/run-pyright.py`.
- id: pyright
name: pyright
entry: make quick_pyright
stages: [pre-push]
# This means pre-commit will not try to install a new environment for this hook. It relies on
# having a pre-existing `make` installed (and scripts/run-pyright.py).
language: system
pass_filenames: false
types: [python]
# We do not use pyright's provided pre-commit hook because we need the environment management
# supplied by `scripts/run-pyright.py`.
- id: pyright
name: pyright
entry: make quick_pyright
stages: [pre-push]
# This means pre-commit will not try to install a new environment for this hook. It relies on
# having a pre-existing `make` installed (and scripts/run-pyright.py).
language: system
pass_filenames: false
types: [python]
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"expectation_suite_name = # TODO: set to a name from the list above"
"expectation_suite_name = None # TODO: set to a name from the list above"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"metadata": {},
"outputs": [],
"source": [
"datasource_name = # TODO: set to a datasource name from above"
"datasource_name = None # TODO: set to a datasource name from above"
]
},
{
Expand Down Expand Up @@ -231,10 +231,10 @@
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"expectation_suite_name = # TODO: set to a name from the list above"
"expectation_suite_name = None # TODO: set to a name from the list above"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"metadata": {},
"outputs": [],
"source": [
"datasource_name = # TODO: set to a datasource name from above"
"datasource_name = None # TODO: set to a datasource name from above"
]
},
{
Expand Down Expand Up @@ -232,10 +232,10 @@
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"expectation_suite_name = # TODO: set to a name from the list above"
"expectation_suite_name = None # TODO: set to a name from the list above"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"metadata": {},
"outputs": [],
"source": [
"datasource_name = # TODO: set to a datasource name from above"
"datasource_name = None # TODO: set to a datasource name from above"
]
},
{
Expand Down Expand Up @@ -234,10 +234,10 @@
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,15 @@ filterwarnings = [

target-version = "py38"

# *.py, *.ipy are included by default
extend-include = ["*.ipynb"]

extend-exclude = [
"*/__generated__/*",
"*/dagster_airflow/vendor/*",
"*/_vendored/*",
"*/snapshots/*",
"python_modules/libraries/dagstermill/dagstermill_tests/notebooks/cli_test_scaffold.ipynb",
]

# Codebase-wide default line length. Override in package-specific pyproject.toml where a different
Expand All @@ -116,6 +120,9 @@ required-version = "0.5.5"

[tool.ruff.lint]

# we only want to format notebooks, not lint them
exclude = ["*.ipynb"]

ignore = [

# (missing public docstrings) These work off of the Python sense of "public", rather than our
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"expectation_suite_name = # TODO: set to a name from the list above"
"expectation_suite_name = None # TODO: set to a name from the list above"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"metadata": {},
"outputs": [],
"source": [
"datasource_name = # TODO: set to a datasource name from above"
"datasource_name = None # TODO: set to a datasource name from above"
]
},
{
Expand Down Expand Up @@ -231,10 +231,10 @@
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"expectation_suite_name = # TODO: set to a name from the list above"
"expectation_suite_name = None # TODO: set to a name from the list above"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"metadata": {},
"outputs": [],
"source": [
"datasource_name = # TODO: set to a datasource name from above"
"datasource_name = None # TODO: set to a datasource name from above"
]
},
{
Expand Down Expand Up @@ -232,10 +232,10 @@
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"expectation_suite_name = # TODO: set to a name from the list above"
"expectation_suite_name = None # TODO: set to a name from the list above"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"metadata": {},
"outputs": [],
"source": [
"datasource_name = # TODO: set to a datasource name from above"
"datasource_name = None # TODO: set to a datasource name from above"
]
},
{
Expand Down Expand Up @@ -234,10 +234,10 @@
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"expectation_suite_name = # TODO: set to a name from the list above"
"expectation_suite_name = None # TODO: set to a name from the list above"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"metadata": {},
"outputs": [],
"source": [
"datasource_name = # TODO: set to a datasource name from above"
"datasource_name = None # TODO: set to a datasource name from above"
]
},
{
Expand Down Expand Up @@ -231,10 +231,10 @@
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"expectation_suite_name = # TODO: set to a name from the list above"
"expectation_suite_name = None # TODO: set to a name from the list above"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"metadata": {},
"outputs": [],
"source": [
"datasource_name = # TODO: set to a datasource name from above"
"datasource_name = None # TODO: set to a datasource name from above"
]
},
{
Expand Down Expand Up @@ -232,10 +232,10 @@
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"expectation_suite_name = # TODO: set to a name from the list above"
"expectation_suite_name = None # TODO: set to a name from the list above"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"metadata": {},
"outputs": [],
"source": [
"datasource_name = # TODO: set to a datasource name from above"
"datasource_name = None # TODO: set to a datasource name from above"
]
},
{
Expand Down Expand Up @@ -234,10 +234,10 @@
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
Expand Down
1 change: 1 addition & 0 deletions scripts/templates_create_dagster_package/__init__.py.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dagster._core.libraries import DagsterLibraryRegistry

from .version import __version__ as __version__

DagsterLibraryRegistry.register("{{ hyphen_name }}", __version__)