Skip to content

Commit

Permalink
Remove isort + update ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
illusional committed Mar 6, 2024
1 parent 085efe5 commit 6dd4768
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 34 deletions.
21 changes: 11 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.4.0
hooks:
- id: check-yaml
exclude: '\.*conda/.*'
Expand All @@ -19,21 +17,19 @@ repos:
rev: v0.38.0
hooks:
- id: markdownlint

- repo: https://github.com/pycqa/isort
rev: 5.13.2
- repo: https://github.com/populationgenomics/pre-commits
rev: "v0.1.3"
hooks:
- id: isort
name: isort (python)
- id: cpg-id-checker

- repo: https://github.com/ambv/black
rev: 23.12.1
rev: 24.2.0
hooks:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.11
rev: v0.3.0
hooks:
- id: ruff

Expand All @@ -51,3 +47,8 @@ repos:
--non-interactive,
]
additional_dependencies: [types-PyYAML==6.0.4, types-toml]

- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck
48 changes: 24 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,10 @@
line-length = 88
skip-string-normalization = true

[tool.isort]
py_version = 311
profile = "black"
line_length = 88
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "HAIL", "CPG", "FIRSTPARTY", "LOCALFOLDER"]
known_hail = [
"hail",
"hailtop",
]
# Adjust these for each repository, e.g., removing those that should be
# local rather than CPG. Also fill in extend_skip below if there are any
# subdirectories that should be ignored.
known_cpg = [
"analysis_runner",
"cpg_infra",
"cpg_utils",
"cpg_workflows",
"gnomad",
"hail_scripts",
"metamist",
]
# extend_skip = ["list", "submodules", "etc", here"]

[tool.ruff]
line-length = 88

[tool.ruff.lint]
# ignore pydocstyle, flake8-boolean-trap (FBT)
select = ["A", "B", "C", "E", "F", "G", "I", "N", "Q", "S", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "ERA", "EXE", "ICN", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "UP", "YTT"]

Expand All @@ -36,6 +14,7 @@ fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN
ignore = [
"ANN101", # Missing type annotation for self in method
"ANN201", # Missing return type annotation for public function
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`
"E501", # Line length too long
"E731", # Do not assign a lambda expression, use a def
"E741", # Ambiguous variable name
Expand All @@ -48,5 +27,26 @@ ignore = [
"PT018", # Assertion should be broken down into multiple parts
"Q000", # Single quotes found but double quotes preferred
"S101", # Use of assert detected
"I001", # Import block is un-sorted (we use isort directly as ruff sort isn't fully supported)
]

[tool.ruff.lint.isort]

section-order = ["future", "standard-library", "third-party", "hail", "cpg", "first-party", "local-folder"]

[tool.ruff.lint.isort.sections]
hail = [
"hail",
"hailtop",
]
# Adjust these for each repository, e.g., removing those that should be
# local rather than CPG. Also fill in extend_skip below if there are any
# subdirectories that should be ignored.
cpg = [
"analysis_runner",
"cpg_infra",
"cpg_utils",
"cpg_workflows",
"gnomad",
"hail_scripts",
"metamist",
]

0 comments on commit 6dd4768

Please sign in to comment.