Skip to content

Commit

Permalink
STYLE: Format code using ruff
Browse files Browse the repository at this point in the history
Format the code using `ruff`: supersedes `flake8` and `blue`.

`blue` was not being applied previously as the relevant `pre-commit`
hook config block was commented in the.

Remove the `.flake8` config file: in practice few rules were being
applied as the config file contained a significant number fo ignored
rules.
  • Loading branch information
jhlegarreta committed Apr 27, 2024
1 parent 14851c6 commit ea4ccc0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 47 deletions.
14 changes: 0 additions & 14 deletions .flake8

This file was deleted.

12 changes: 0 additions & 12 deletions .pep8speaks.yml

This file was deleted.

11 changes: 2 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ repos:
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
# - repo: https://github.com/grantjenks/blue
# rev: v0.9.1
# hooks:
# - id: blue
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
exclude: "^(docs/experimental|tools)/"
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
Expand Down Expand Up @@ -52,3 +43,5 @@ repos:
# Run the linter
- id: ruff
args: [ --fix ]
# Run the formatter
- id: ruff-format
43 changes: 31 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ doc = [
"texext",
"tomli; python_version < \"3.11\"",
]
style = ["flake8", "blue", "ruff", "pre-commit"]
style = ["ruff", "pre-commit"]
typing = ["mypy", "types-Pillow", "data-science-types"]
test = [
"coverage",
Expand All @@ -97,19 +97,38 @@ raw-options = { version_scheme = "release-branch-semver" }
[tool.hatch.build.hooks.vcs]
version-file = "fury/_version.py"

[tool.blue]
[tool.ruff]
line_length = 88
target-version = ["py38"]
force-exclude = """
(
_version.py
*docs/experimental/*
)
"""

[flake8]
max-line-length = 88
extend-exclude = ["_version.py", "externals", "*docs/experimental*"]
exclude = [
".git",
"__pycache__",
"build",
"dist",
"_version.py",
]

[tool.ruff.lint]
select = [
"F",
"E",
"C",
"W",
"B",
"I",
]
ignore = [
"E203"
]

[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"

[tool.ruff.format]
quote-style = "double"

[tool.ruff.lint.isort]
known-first-party=["fury"]

[tool.mypy]
python_version = "3.11"
Expand Down

0 comments on commit ea4ccc0

Please sign in to comment.