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 8, 2024
1 parent e799f5a commit 0907f4c
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 184 deletions.
57 changes: 31 additions & 26 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
- repo: local
hooks:
- 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
Loading

0 comments on commit 0907f4c

Please sign in to comment.