Skip to content

Commit

Permalink
unify local and pre-commit ruff configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgafni committed Aug 19, 2024
1 parent 7f65670 commit 5d8d375
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 60 deletions.
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 Line
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__)

0 comments on commit 5d8d375

Please sign in to comment.