Skip to content

Commit

Permalink
update ruff config paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilo59 committed Feb 26, 2024
1 parent e7854cf commit 029ba9c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions contrib/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# root linter settings are defined in the file below
extend = "../pyproject.toml"

extend-ignore = [
lint.extend-ignore = [
# https://github.com/charliermarsh/ruff#flake8-type-checking-tch
# This is likely to be a high-touch rule that most contribs don't need to care about.
"TCH001",
Expand All @@ -19,6 +19,6 @@ extend-ignore = [
"NPY002", # these methods are deprecated in numpy 2 but will not be removed
]

[isort]
[lint.isort]
known-first-party = ["great_expectations", "tests"]
known-third-party = ["dataprofiler", "capitalone_dataprofiler_expectations"]
2 changes: 1 addition & 1 deletion great_expectations/dataset/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
extend = "../../pyproject.toml"

# relaxing linting rules for legacy dataset module
extend-ignore = [
lint.extend-ignore = [
# https://github.com/charliermarsh/ruff#pyflakes-f
"F841", # unused-variable
# https://github.com/charliermarsh/ruff#error-e
Expand Down
22 changes: 9 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ warn_untyped_fields = true
[tool.ruff]
target-version = "py38"
line-length = 88
select = [
lint.preview = true # This enables preview rules for specified rules e.g. NPY201
lint.explicit-preview-rules = true # https://docs.astral.sh/ruff/preview/#selecting-single-preview-rules
lint.select = [
# https://beta.ruff.rs/docs/rules/#pyflakes-f
"F", # Pyflakes
# https://beta.ruff.rs/docs/rules/#pycodestyle-e-w
Expand Down Expand Up @@ -261,7 +263,7 @@ select = [
"NPY", # NumPy-specific rules TODO: Enable after fixing or ignoring errors
"NPY201", # numpy 2.0 compatibility (see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#ruff-plugin) -- Explicitly listed to view preview rule errors
]
ignore = [
lint.ignore = [
# https://beta.ruff.rs/docs/rules/#pyflakes-f
"F842", # variable annotated but unused # TODO enable
# https://beta.ruff.rs/docs/rules/#pycodestyle-e-w
Expand Down Expand Up @@ -309,12 +311,7 @@ extend-exclude = [
"tests/dataset", # 10 warnings
]

[tool.ruff.lint]
# This enables preview rules for specified rules e.g. NPY201
preview = true
explicit-preview-rules = true # https://docs.astral.sh/ruff/preview/#selecting-single-preview-rules

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"assets/benchmark/benchmark.py" = [
"DTZ", # flake8-datetimez-dtz - doesn't matter for benchmark tests
]
Expand All @@ -341,7 +338,7 @@ explicit-preview-rules = true # https://docs.astral.sh/ruff/preview/#selecting-
"F841", # local variable is assigned to but never used - ignored for code used in snippets
]

[tool.ruff.flake8-type-checking]
[tool.ruff.lint.flake8-type-checking]
# pydantic models use annotations at runtime
runtime-evaluated-base-classes = [
# NOTE: ruff is unable to detect that these are subclasses of pydantic.BaseModel
Expand All @@ -352,14 +349,13 @@ runtime-evaluated-base-classes = [
]
runtime-evaluated-decorators = ["pydantic.dataclasses.dataclass"]

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 15

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.flake8-tidy-imports]
[tool.ruff.flake8-tidy-imports.banned-api]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"os.environ".msg = """Please do not use os.environ outside of configuration files.
If you are working in a configuration file you may use the inline comment \
"# noqa: TID251 # os.environ allowed in config files" to ignore this error."""
Expand Down
4 changes: 2 additions & 2 deletions tests/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# root linter settings are defined in the file below
extend = "../pyproject.toml"

extend-ignore = [
lint.extend-ignore = [
# https://github.com/charliermarsh/ruff#flake8-type-checking-tch
# This is likely to be a high-touch rule. Doing this in `tests` doesn't help circular imports.
# Let's differ this for tests until there are auto-fixes
Expand All @@ -19,5 +19,5 @@ extend-ignore = [
"RUF015", # element index slice is common test pattern
]

[isort]
[lint.isort]
known-first-party = ["great_expectations", "tests"]

0 comments on commit 029ba9c

Please sign in to comment.