psss / did

What did you do last week, month, year?
https://did.readthedocs.io/
GNU General Public License v2.0
247 stars 105 forks source link

Add "name-tests-test" pre-commit hook #287

Closed kwk closed 1 year ago

kwk commented 1 year ago

The name-tests-test hook verifies that test files are named "correctly". That's why all test files have to start with test_*.py.

See https://pre-commit.com/hooks.html

psss commented 1 year ago

What's the motivation for moving the test prefix to suffix? Is there any benefit for that?

kwk commented 1 year ago

What's the motivation for moving the test prefix to suffix? Is there any benefit for that?

Well, I'd say that the benefit is, that we can check for test file naming this way. This documentation shows that you can configure the hook with options to have the check do a prefix test for test_*.py: https://github.com/pre-commit/pre-commit-hooks#name-tests-test. I have enabled that and then we can leave alone the renaming. The only exclusion is disable_test_trac.py. Would this be fine?