Skip to content

Commit

Permalink
Replace flake8 with ruff and consolidate configs
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Sep 27, 2023
1 parent ce91aa5 commit c1fca0f
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 54 deletions.
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

File renamed without changes.
28 changes: 17 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ exclude: |
test-skeleton
)/ |
.*\.(patch|diff) |
versioneer.py |
conda_build/_version.py
)
repos:
# generic verification and formatting
Expand Down Expand Up @@ -52,11 +50,6 @@ repos:
# upgrade standard Python codes
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
# auto sort Python imports
- id: isort
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
Expand All @@ -68,8 +61,21 @@ repos:
# auto format Python codes within docstrings
- id: blacken-docs
additional_dependencies: [black]
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
hooks:
- id: ruff
args: [--fix]
- repo: meta
# see https://pre-commit.com/#meta-hooks
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: local
hooks:
# lint Python codes
- id: flake8
- id: git-diff
name: git diff
entry: git diff --exit-code
language: system
pass_filenames: false
always_run: true
53 changes: 50 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,54 @@ include = ["conda_build", "conda_build/templates/*", "conda_build/cli-*.exe"]
version-file = "conda_build/__version__.py"

[tool.black]
target-version = ['py38', 'py39', 'py310']
target-version = ['py38', 'py39', 'py310', 'py311']

[tool.isort]
profile = "black"
[tool.coverage.run]
# store relative paths in coverage information
relative_files = true

[tool.coverage.report]
show_missing = true
sort = "Miss"
skip_covered = true
omit = ["conda_build/skeletons/_example_skeleton.py"]

[tool.ruff]
line-length = 180
# E, W = pycodestyle errors and warnings
# F = pyflakes
# I = isort
# D = pydocstyle
select = ["E", "W", "F", "I", "D1"]
# E402 module level import not at top of file
# E722 do not use bare 'except'
# E731 do not assign a lambda expression, use a def
ignore = ["E402", "E722", "E731"]
# Use PEP 257-style docstrings.
pydocstyle = {convention = "pep257"}

[tool.pytest.ini_options]
minversion = 3.0
testpaths = ["tests"]
norecursedirs = ["tests/test-recipes/*"]
addopts = [
"--color=yes",
# "--cov=conda_build", # passed in test runner scripts instead (avoid debugger)
"--cov-append",
"--cov-branch",
"--cov-report=term-missing",
"--cov-report=xml",
"--durations=16",
"--junitxml=junit.xml",
"--splitting-algorithm=least_duration",
"--store-durations",
"--strict-markers",
"--tb=native",
"-vv",
]
markers = [
"serial: execute test serially (to avoid race conditions)",
"slow: execute the slow tests if active",
"sanity: execute the sanity tests",
"no_default_testing_config: used internally to disable monkeypatching for testing_config",
]
37 changes: 0 additions & 37 deletions setup.cfg

This file was deleted.

0 comments on commit c1fca0f

Please sign in to comment.