Skip to content

Commit 0cefa52

Browse files
committed
dep: add pre-commit to dev dependencies
1 parent b41f0b8 commit 0cefa52

21 files changed

Lines changed: 121 additions & 20 deletions

File tree

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,4 @@ repos:
1919
hooks:
2020
- id: ruff
2121
args: [--fix, --exit-non-zero-on-fix]
22-
exclude: ^(docs/_themes/|docs/conf\.py|e2e_projects/|tests/data/test_generation/)
2322
- id: ruff-format
24-
exclude: ^(docs/_themes/|docs/conf\.py|e2e_projects/|tests/data/test_generation/)

CONTRIBUTING.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ Codebases using Poetry
4646
# Install dependencies in your Poetry environment
4747
pip install -r <path_to_mutmut_codebase>/requirements.txt
4848
49+
50+
Linting and Formatting
51+
^^^^^^^^^^^^^^^^^^^^^^
52+
53+
This project primarily uses `ruff` for linting and formatting through `pre-commit`. You can run the linting and formatting locally with `uv run pre-commit run --all-files`.
54+
55+
Additionally (and recommended), you can run `pre-commit install` to install the pre-commit hooks to run automatically when running `git commit`.
56+
4957
Documentation about mutmut's architecture
5058
-----------------------------------------
5159

e2e_projects/config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This project uses most/all of the mutmut configuration in pyproject.toml.
1+
This project uses most/all of the mutmut configuration in pyproject.toml.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def this_function_shall_NOT_be_mutated():
2-
return 1 + 2
2+
return 1 + 2

e2e_projects/config/data/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"comment": "this should be copied to the mutants folder"
3-
}
3+
}

e2e_projects/config/tests/main/test_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_include_data_exists():
2626
data = json.load(f)
2727
assert data['comment'] == 'this should be copied to the mutants folder'
2828

29-
# ignored, because it does not match -k 'test_include'
29+
# ignored, because it does not match -k 'test_include'
3030
def test_should_be_ignored():
3131
assert 'This test should be ignored' == 1234
3232

@@ -38,4 +38,4 @@ def test_include_xfail_that_does_not_fail():
3838
# ignored, because of -m 'not fail'
3939
@pytest.mark.fail
4040
def test_include_that_should_be_ignored():
41-
assert 'This test should be ignored' == 1234
41+
assert 'This test should be ignored' == 1234

e2e_projects/mutate_only_covered_lines/src/mutate_only_covered_lines/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ def mutate_only_covered_lines_multiline(simple_branch: bool) -> str:
4040
]
4141
return f"Hello from mutate_only_covered_lines!" \
4242
f" (false) {x} {y}"
43-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def this_function_shall_NOT_be_mutated():
2-
return 1 + 2
2+
return 1 + 2

e2e_projects/mutate_only_covered_lines/tests/main/test_mutate_only_covered_lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ def test_mutate_only_covered_lines_multiline():
1313
assert mutate_only_covered_lines_multiline(True) == "Hello from mutate_only_covered_lines! (true) FooBar [0, 4, 8, 12, 16]"
1414

1515
def call_ignored_function():
16-
assert this_function_shall_NOT_be_mutated() == 3
16+
assert this_function_shall_NOT_be_mutated() == 3

e2e_projects/my_lib/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This project will be E2E tested. It mainly serves as a "canary" that alerts you when code changes affect which mutants survive.
1+
This project will be E2E tested. It mainly serves as a "canary" that alerts you when code changes affect which mutants survive.

0 commit comments

Comments
 (0)