Skip to content

Commit

Permalink
Focus on just ruff/clippy, drop flake8.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Nov 7, 2023
1 parent 22c794a commit 1ae3afb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
27 changes: 16 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ BRZ_PLUGIN_PATH=-site:-user
sw = $(sort $(wildcard $(1)))


.PHONY: all clean realclean extensions flake8 api-docs check-nodocs check clippy clippy-fix ruff ruff-fix
.PHONY: all clean realclean extensions api-docs check-nodocs check clippy clippy-fix

all: extensions

extensions:
@echo "building extension modules."
$(PYTHON) setup.py build_ext -i $(PYTHON_BUILDFLAGS)

check: docs check-nodocs
check:: docs check-nodocs

check-nodocs: brz
-$(RM) -f selftest.log
Expand All @@ -67,16 +67,12 @@ check-ci: docs extensions brz
brz:
$(PYTHON) setup.py build_rust -i $(PYTHON_BUILDFLAGS)

# Run Python style checker (apt-get install flake8)
#
# Note that at present this gives many false warnings, because it doesn't
# know about identifiers loaded through lazy_import.
flake8:
$(PYTHON) -m flake8 breezy
fmt-check:: rust-fmt-check

fmt-check:
rust-fmt-check:
find crates breezy -name '*.rs' | xargs rustfmt --check
flake8 breezy

check:: mypy

mypy:
$(PYTHON) -m mypy breezy
Expand Down Expand Up @@ -320,24 +316,33 @@ check-dist-tarball:
rm -rf $$tmpdir

reformat:
isort .
find breezy crates -name '*.rs' | xargs rustfmt
ruff format .

clippy-fix:
cargo clippy --fix --all --allow-no-vcs

clippy:
cargo clippy --all

.PHONY: ruff

check:: ruff

ruff:
ruff check .

.PHONY: ruff-fix

ruff-fix:
ruff check --fix .

fix: clippy ruff-fix
$(MAKE) reformat

format-check:
$(MAKE) ruff --check

.testrepository:
testr init

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ dev = [
"testtools>=0.9.5",
"testscenarios",
"python-subunit",
"flake8",
"cython>=0.29",
"ruff",
]
Expand Down
3 changes: 2 additions & 1 deletion tarmac.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[Tarmac]
setup_command = sudo apt -y update && sudo apt -y install git quilt cargo rustc python3-venv python3-tdb python3-pyinotify python3-gpg libpython3-dev make python3-setuptools-rust openssh-client patch mypy flake8 rustfmt isort xz-utils
setup_command = sudo apt -y update && sudo apt -y install git quilt cargo rustc python3-venv python3-tdb python3-pyinotify python3-gpg libpython3-dev make python3-setuptools-rust openssh-client patch mypy rustfmt xz-utils
verify_command = python3 -m venv --system-site-packages . && . bin/activate && ./bin/pip3 install setuptools-gettext && ./bin/pip3 install --upgrade -e .[dev,doc,pgp,fastimport,launchpad,git,paramiko] && make extensions docs mypy fmt-check ruff PYTHON=$PWD/bin/python && BRZ_PLUGIN_PATH=-site:-user ./bin/python -m breezy selftest -v --parallel=fork
post_merge_command = make fix
verify_command_output_timeout = 1800
commit_message_template = <commit_message>

Expand Down

0 comments on commit 1ae3afb

Please sign in to comment.