Skip to content

Commit

Permalink
Switch to ruff for formatting (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
willkg committed Dec 28, 2023
1 parent 203d004 commit ab9a545
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ help:
test: ## Run tests, linting, and static typechecking
tox

.PHONY: format
format: ## Format files
tox exec -e py38-lint -- ruff format

.PHONY: lint
lint: ## Lint and black reformat files
# NOTE(willkg): Make sure this matches what's in tox.ini.
black src setup.py tests docs examples
lint: ## Lint files
tox -e py38-lint

.PHONY: clean
Expand Down
12 changes: 4 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@
# Enable pycodestyle (E), pyflakes (F), and bugbear (B) rules
select = ["E", "F", "B"]

# Ignore line length violations--Black handles those
# Ignore line length violations
line-length = 88
ignore = ["E501"]

target-version = "py37"
target-version = "py38"

src = ["src"]

[tool.ruff.flake8-quotes]
docstring-quotes = "double"


[tool.black]
line-length = 88
target-version = ["py38"]

[tool.mypy]
python_version = "3.8"
disallow_untyped_defs = true
Expand Down Expand Up @@ -75,8 +71,8 @@ commands = pytest --doctest-modules src/
basepython = python3.8
changedir = {toxinidir}
commands =
black --diff setup.py tests docs examples
ruff src setup.py tests docs examples
ruff format --check setup.py tests docs examples
ruff check src setup.py tests docs examples
[testenv:py38-typecheck]
basepython = python3.8
Expand Down
9 changes: 4 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Requirements file for developing on Everett.
-e .[ini,yaml,sphinx]

black==23.9.1
check-manifest==0.49
cogapp==3.3.0
mypy==1.5.1
pytest==7.4.2
ruff==0.0.292
tox==4.11.3
mypy==1.8.0
pytest==7.4.3
ruff==0.1.9
tox==4.11.4
tox-gh-actions==3.1.3
twine==4.0.2
types-PyYAML==6.0.12.12
Expand Down

0 comments on commit ab9a545

Please sign in to comment.