Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
args: ['--fix', 'lf']
- id: fix-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
hooks:
- id: ruff-check
args: ['--fix', '--unsafe-fixes']
- id: ruff-format
93 changes: 0 additions & 93 deletions scripts/all-pythons

This file was deleted.

7 changes: 3 additions & 4 deletions scripts/update-rtfd
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

from urllib2 import urlopen

WEB_HOOK = "http://readthedocs.org/build/588"

WEB_HOOK = 'http://readthedocs.org/build/588'


if __name__ == '__main__':
urlopen(WEB_HOOK, data=' ')
if __name__ == "__main__":
urlopen(WEB_HOOK, data=" ")
Empty file modified testtools/run.py
100755 → 100644
Empty file.
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ commands =

[testenv:ruff]
deps =
ruff
pre-commit
commands =
ruff check --fix .
ruff format .
pre-commit run -a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid this? I'm happy to see config for pre-commit shipped, but don't really want to add it as a hard dependency.

Copy link
Contributor Author

@stephenfin stephenfin Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concern with not doing this is that you end with two linter configurations which may subtly differ. This usually means someone who uses pre-commit will end up getting a whole load of fixes on unrelated code because others haven't run it for X time.

More to the point, I don't think there's really a dependency here. It's not needed at runtime. Distro packagers don't need to worry about. Devs don't need to even install it on their system since they can just rely on tox to do so. (I also wouldn't call tox a dependency for similar reasoning)

Copy link
Member

@jelmer jelmer Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm happy to see pre-commit config added if people find that helpful. It does add extra overhead in cases that aren't really precommits (i.e. CI) and I don't personally use it.

We already have configuration for ruff, tox, CI, testr as well as a Makefile that all have config for how to run tests/linting/etc.


[testenv:mypy]
deps =
Expand Down