Skip to content

Tests and pre-commit hooks are broken #213

@tigist-far

Description

@tigist-far

Describe the bug

When running the tests and pre-commit hooks (linting, etc.) I get a significant number of errors. Perhaps introducing CI checks before merge can prevent this kind of regression.

Steps/Code to reproduce bug

To run tests:

uv run pytest

To run the pre-commit hooks:

uv run pre-commit run --all-files

Error logs

Error message I get when running tests
(nemotron) ➜  Nemotron git:(main) uv run pytest
============================================================================================================================================================================== test session starts ==============================================================================================================================================================================
platform darwin -- Python 3.12.13, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/tigist/Code/external/Nemotron
configfile: pyproject.toml
testpaths: tests
plugins: anyio-4.9.0, Faker-20.1.0, cov-7.0.0
collected 763 items / 6 errors                                                                                                                                                                                                                                                                                                                                                  

==================================================================================================================================================================================== ERRORS =====================================================================================================================================================================================
_________________________________________________________________________________________________________________________________________________________ ERROR collecting tests/data_prep/test_binidx_stage_resume.py __________________________________________________________________________________________________________________________________________________________
ImportError while importing test module '/Users/tigist/Code/external/Nemotron/tests/data_prep/test_binidx_stage_resume.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/uv/python/cpython-3.12.13-macos-aarch64-none/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/data_prep/test_binidx_stage_resume.py:35: in <module>
    from nemotron.data_prep.filesystem import read_json
E   ModuleNotFoundError: No module named 'nemotron.data_prep.filesystem'
______________________________________________________________________________________________________________________________________________________________ ERROR collecting tests/data_prep/test_stage_keys.py ______________________________________________________________________________________________________________________________________________________________
ImportError while importing test module '/Users/tigist/Code/external/Nemotron/tests/data_prep/test_stage_keys.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/uv/python/cpython-3.12.13-macos-aarch64-none/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/data_prep/test_stage_keys.py:21: in <module>
    from nemotron.data_prep.stage_keys import (
E   ModuleNotFoundError: No module named 'nemotron.data_prep.stage_keys'
_________________________________________________________________________________________________________________________________________________________________ ERROR collecting tests/kit/cli/test_utils.py __________________________________________________________________________________________________________________________________________________________________
ImportError while importing test module '/Users/tigist/Code/external/Nemotron/tests/kit/cli/test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/uv/python/cpython-3.12.13-macos-aarch64-none/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/kit/cli/test_utils.py:19: in <module>
    from nemotron.kit.cli.utils import (
E   ModuleNotFoundError: No module named 'nemotron.kit.cli'
_____________________________________________________________________________________________________________________________________________________________ ERROR collecting tests/kit/test_resolvers_pre_init.py _____________________________________________________________________________________________________________________________________________________________
ImportError while importing test module '/Users/tigist/Code/external/Nemotron/tests/kit/test_resolvers_pre_init.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/uv/python/cpython-3.12.13-macos-aarch64-none/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/kit/test_resolvers_pre_init.py:20: in <module>
    from nemotron.kit import resolvers
E   ImportError: cannot import name 'resolvers' from 'nemotron.kit' (/Users/tigist/Code/external/Nemotron/src/nemotron/kit/__init__.py)
___________________________________________________________________________________________________________________________________________ ERROR collecting tests/recipes/nano3/stage0_pretrain/test_data_prep_train_integration.py ____________________________________________________________________________________________________________________________________________
ImportError while importing test module '/Users/tigist/Code/external/Nemotron/tests/recipes/nano3/stage0_pretrain/test_data_prep_train_integration.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/uv/python/cpython-3.12.13-macos-aarch64-none/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/recipes/nano3/stage0_pretrain/test_data_prep_train_integration.py:36: in <module>
    from nemotron.data_prep.filesystem import get_filesystem
E   ModuleNotFoundError: No module named 'nemotron.data_prep.filesystem'
______________________________________________________________________________________________________________________________________________ ERROR collecting tests/recipes/nano3/stage2_rl/test_data_prep_train_integration.py _______________________________________________________________________________________________________________________________________________
ImportError while importing test module '/Users/tigist/Code/external/Nemotron/tests/recipes/nano3/stage2_rl/test_data_prep_train_integration.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/uv/python/cpython-3.12.13-macos-aarch64-none/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/recipes/nano3/stage2_rl/test_data_prep_train_integration.py:39: in <module>
    from nemotron.data_prep.hf_placeholder import (
E   ModuleNotFoundError: No module named 'nemotron.data_prep.hf_placeholder'
=============================================================================================================================================================================== warnings summary ================================================================================================================================================================================
.venv/lib/python3.12/site-packages/starlette/middleware/wsgi.py:15
  /Users/tigist/Code/external/Nemotron/.venv/lib/python3.12/site-packages/starlette/middleware/wsgi.py:15: DeprecationWarning: starlette.middleware.wsgi is deprecated and will be removed in a future release. Please refer to https://github.com/abersheeran/a2wsgi as a replacement.
    warnings.warn(

.venv/lib/python3.12/site-packages/leptonai/photon/types/fileparam.py:38
  /Users/tigist/Code/external/Nemotron/.venv/lib/python3.12/site-packages/leptonai/photon/types/fileparam.py:38: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/
    @validator("content", pre=True)

.venv/lib/python3.12/site-packages/leptonai/photon/types/file.py:120
  /Users/tigist/Code/external/Nemotron/.venv/lib/python3.12/site-packages/leptonai/photon/types/file.py:120: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/
    @validator("content", pre=True)

.venv/lib/python3.12/site-packages/leptonai/api/v0/deployment.py:6
  /Users/tigist/Code/external/Nemotron/.venv/lib/python3.12/site-packages/leptonai/api/v0/deployment.py:6: DeprecationWarning: the leptonai.api.types module is deprecated. Use leptonai.api.v1.types for a more fine grained API service. This backward compatible code might be removed in the future.
    from . import types

.venv/lib/python3.12/site-packages/leptonai/api/v0/__init__.py:8
  /Users/tigist/Code/external/Nemotron/.venv/lib/python3.12/site-packages/leptonai/api/v0/__init__.py:8: DeprecationWarning: the leptonai.api.deployment module is deprecated. Use leptonai.api.v1.types for a more fine grained API service. This backward compatible code might be removed in the future.
    from . import deployment

.venv/lib/python3.12/site-packages/leptonai/api/v0/__init__.py:9
  /Users/tigist/Code/external/Nemotron/.venv/lib/python3.12/site-packages/leptonai/api/v0/__init__.py:9: DeprecationWarning: This module is deprecated and will be removed in the future. Please use leptonai.api.v1 instead.
    from . import job

.venv/lib/python3.12/site-packages/leptonai/api/v0/__init__.py:10
  /Users/tigist/Code/external/Nemotron/.venv/lib/python3.12/site-packages/leptonai/api/v0/__init__.py:10: DeprecationWarning: This module is deprecated and will be removed in the future. Please use leptonai.api.v1 instead.
    from . import kv

.venv/lib/python3.12/site-packages/leptonai/api/__init__.py:25
  /Users/tigist/Code/external/Nemotron/.venv/lib/python3.12/site-packages/leptonai/api/__init__.py:25: DeprecationWarning: The v0 API is deprecated and will be removed in the next major version. Consider using the v1 API for new code.
    from . import v0

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================================================================================================================ short test summary info ============================================================================================================================================================================
ERROR tests/data_prep/test_binidx_stage_resume.py
ERROR tests/data_prep/test_stage_keys.py
ERROR tests/kit/cli/test_utils.py
ERROR tests/kit/test_resolvers_pre_init.py
ERROR tests/recipes/nano3/stage0_pretrain/test_data_prep_train_integration.py
ERROR tests/recipes/nano3/stage2_rl/test_data_prep_train_integration.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================================================================================================================= 8 warnings, 6 errors in 2.91s =========================================================================================================================================================================
Error message I get when running pre-commit hooks

The full error message is attached here.

Below is a truncated version that fits into the word limit of issue messages.

(nemotron) ➜  Nemotron git:(main) uv run pre-commit run --all-files
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing use-case-examples/Data Science ML Agent/src/llm.py
Fixing use-case-examples/Data Science ML Agent/src/chat_agent.py
Fixing src/nemotron/recipes/embed/stage0_sdg/vendor/retriever-sdg/src/retriever_sdg/__init__.py
Fixing use-case-examples/Data Science ML Agent/src/tools/exp_store.py
Fixing src/nemotron/data_prep/packing/materialize.py
Fixing src/nemotron/recipes/embed/stage1_data_prep/scripts/convert_to_retriever_data.py
Fixing src/nemotron/data_prep/config.py
Fixing use-case-examples/Data Science ML Agent/extrapolation.py
Fixing src/nemotron/cli/commands/super3/rl/_base.py
Fixing src/nemotron/data_prep/packing/spool.py
Fixing src/nemo_runspec/config/loader.py
Fixing use-case-examples/nemotron-voice-rag-agent-example/nemotron_family_multimodal_rag_agent/__init__.py
Fixing use-case-examples/Data Science ML Agent/user_interface.py
Fixing src/nemotron/data_prep/packing/bin_assignment.py
Fixing use-case-examples/Data Science ML Agent/src/tools/gpu_tools.py
Fixing docs/conf.py
Fixing src/nemo_runspec/run.py
Fixing tests/kit/test_artifact.py

trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing src/nemotron/recipes/data/sdg/long-document/05-visual-qa-sdg.py
Fixing use-case-examples/Data Science ML Agent/src/llm.py
Fixing use-case-examples/Data Science ML Agent/src/chat_agent.py
Fixing use-case-examples/Data Science ML Agent/src/tools/exp_store.py
Fixing tools/budget/custom_logit_processors/v1/nano_v3_logit_processors.py
Fixing src/nemotron/recipes/embed/stage1_data_prep/scripts/convert_to_retriever_data.py
Fixing src/nemotron/recipes/embed/stage0_sdg/vendor/retriever-sdg/src/retriever_sdg/deduplication.py
Fixing use-case-examples/Data Science ML Agent/user_interface.py
Fixing use-case-examples/Data Science ML Agent/src/tools/gpu_tools.py
Fixing src/nemotron/recipes/embed/stage0_sdg/vendor/retriever-sdg/src/retriever_sdg/pipeline.py

ruff.....................................................................Failed
- hook id: ruff
- exit code: 1
- files were modified by this hook

scripts/test_pack_memory.py:85:5: F841 Local variable `manifest` is assigned to but never used
   |
83 |     log_memory("After writing sequences")
84 |
85 |     manifest = writer.finalize(extra_manifest={
   |     ^^^^^^^^ F841
86 |         "shard_id": "test_shard",
87 |         "shard_index": 0,
   |
   = help: Remove assignment to unused variable `manifest`

scripts/test_pack_memory.py:180:5: F841 Local variable `result` is assigned to but never used
    |
178 |     print("\n--- Running pack as Ray task ---")
179 |     result_ref = pack_task.remote(spool_dir, output_dir, pack_size)
180 |     result = ray.get(result_ref)
    |     ^^^^^^ F841
181 |     log_memory("After ray.get() of pack task")
    |
    = help: Remove assignment to unused variable `result`

src/nemo_runspec/_pyproject.py:40:8: UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`
   |
38 |     if isinstance(value, bool):
39 |         return "true" if value else "false"
40 |     if isinstance(value, (int, float)):
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP038
41 |         return str(value)
42 |     if isinstance(value, list):
   |
   = help: Convert to `X | Y`

src/nemo_runspec/config/loader.py:197:9: N806 Variable `_RESOURCE_KEYS` in function should be lowercase
    |
195 |         # The recipe knows how many nodes/GPUs it needs; env.toml provides cluster
196 |         # logistics (account, partition, tunnel, mounts) the recipe doesn't know about.
197 |         _RESOURCE_KEYS = ("nodes", "gpus_per_node", "ntasks_per_node", "nproc_per_node")
    |         ^^^^^^^^^^^^^^ N806
198 |         for key in _RESOURCE_KEYS:
199 |             if key in existing_env:
    |

...

tools/budget/custom_logit_processors/v1/nano_v3_logit_processors.py:101:120: E501 Line too long (148 > 119)
    |
 99 | …
100 | …
101 | …d state["output_tok_ids"][-1] in NEWLINE_TOKENS and not state["start_of_end"]:
    |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
102 ||

tools/budget/custom_logit_processors/v1/nano_v3_logit_processors.py:124:120: E501 Line too long (2973 > 119)
    |
122 | …
123 | …
124 | …Leesins World Championship comes to an end! \n\nThe tournament consisted of $n$ ($n \\ge 5$) teams around the world. Before the tournament starts, Bob has made a prediction of the rankings of each team, from $1$-st to $n$-th. After the final, he compared the prediction with the actual result and found out that the $i$-th team according to his prediction ended up at the $p_i$-th position ($1 \\le p_i \\le n$, all $p_i$ are unique). In other words, $p$ is a permutation of $1, 2, \\dots, n$.\n\nAs Bob's favorite League player is the famous \"3ga\", he decided to write down every $3$ consecutive elements of the permutation $p$. Formally, Bob created an array $q$ of $n-2$ triples, where $q_i = (p_i, p_{i+1}, p_{i+2})$ for each $1 \\le i \\le n-2$. Bob was very proud of his array, so he showed it to his friend Alice.\n\nAfter learning of Bob's array, Alice declared that she could retrieve the permutation $p$ even if Bob rearranges the elements of $q$ and the elements within each triple. Of course, Bob did not believe in such magic, so he did just the same as above to see Alice's respond.\n\nFor example, if $n = 5$ and $p = [1, 4, 2, 3, 5]$, then the original array $q$ will be $[(1, 4, 2), (4, 2, 3), (2, 3, 5)]$. Bob can then rearrange the numbers within each triple and the positions of the triples to get $[(4, 3, 2), (2, 3, 5), (4, 1, 2)]$. Note that $[(1, 4, 2), (4, 2, 2), (3, 3, 5)]$ is not a valid rearrangement of $q$, as Bob is not allowed to swap numbers belong to different triples.\n\nAs Alice's friend, you know for sure that Alice was just trying to show off, so you decided to save her some face by giving her any permutation $p$ that is consistent with the array $q$ she was given. \n\n\n-----Input-----\n\nThe first line contains a single integer $n$ ($5 \\le n \\le 10^5$) — the size of permutation $p$.\n\nThe $i$-th of the next $n-2$ lines contains $3$ integers $q_{i, 1}$, $q_{i, 2}$, $q_{i, 3}$ ($1 \\le q_{i, j} \\le n$) — the elements of the $i$-th triple of the rearranged (shuffled) array $q_i$, in random order. Remember, that the numbers within each triple can be rearranged and also the positions of the triples can be rearranged.\n\nIt is guaranteed that there is at least one permutation $p$ that is consistent with the input. \n\n\n-----Output-----\n\nPrint $n$ distinct integers $p_1, p_2, \\ldots, p_n$ ($1 \\le p_i \\le n$) such that $p$ is consistent with array $q$. \n\nIf there are multiple answers, print any. \n\n\n-----Example-----\nInput\n5\n4 3 2\n2 3 5\n4 1 2\n\nOutput\n1 4 2 3 5\n\n\nRead the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.\n```python\n# YOUR CODE HERE\n```"""
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^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^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
125 | …sg}]
126 | …Write a haiku about a cat"}]
    |

tools/budget/custom_logit_processors/v1/nano_v3_logit_processors.py:126:120: E501 Line too long (142 > 119)
    |
124 | …ns\", and today he celebrates as the League of Leesins World Championship comes to an end! \n\nThe tournament consisted of $n$ ($n \…
125 | …sistant. /think"},{"role": "user", "content": msg}]
126 | …sistant. /think"},{"role": "user", "content": "Write a haiku about a cat"}]
    |                                                      ^^^^^^^^^^^^^^^^^^^^^^^ E501
127 | …
    |

tools/budget/custom_logit_processors/v1/nano_v3_logit_processors.py:129:120: E501 Line too long (125 > 119)
    |
127 |     tokenizer = AutoTokenizer.from_pretrained(model)
128 |
129 |     prompts = [tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, add_special_tokens=False),
    |                                                                                                                        ^^^^^^ E501
130 |             tokenizer.apply_chat_template(messages2, tokenize=False, add_generation_prompt=True, add_special_tokens=False)]
    |

tools/budget/custom_logit_processors/v1/nano_v3_logit_processors.py:130:120: E501 Line too long (123 > 119)
    |
129 |     prompts = [tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, add_special_tokens=False),
130 |             tokenizer.apply_chat_template(messages2, tokenize=False, add_generation_prompt=True, add_special_tokens=False)]
    |                                                                                                                        ^^^^ E501
131 |
132 |     sampling_params_list = [SamplingParams(temperature=0.6, max_tokens=1220, extra_args={"thinking_budget": 150, "thinking_budget_gra…
    |

tools/budget/custom_logit_processors/v1/nano_v3_logit_processors.py:132:120: E501 Line too long (253 > 119)
    |
130 | …s=False)]
131 | …
132 | …thinking_budget_grace_period": 30, "end_token_ids":[1871, 5565, 11483, 6139, 1046, 2259, 74045, 1062]}), # Reached thinking limit. </think>
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
133 | …thinking_budget_grace_period": 20, "end_token_ids":[2259, 74045, 1062]})] # </think>
    |

tools/budget/custom_logit_processors/v1/nano_v3_logit_processors.py:133:120: E501 Line too long (198 > 119)
    |
132 | …ing_budget": 150, "thinking_budget_grace_period": 30, "end_token_ids":[1871, 5565, 11483, 6139, 1046, 2259, 74045, 1062]}), # Reache…
133 | …ing_budget": 120, "thinking_budget_grace_period": 20, "end_token_ids":[2259, 74045, 1062]})] # </think>
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501
134 | …
135 ||

Found 611 errors (326 fixed, 285 remaining).
No fixes available (24 hidden fixes can be enabled with the `--unsafe-fixes` option).

ruff.....................................................................Failed
- hook id: ruff
- files were modified by this hook

warning: Failed to lint check: No such file or directory (os error 2)
Found 3 errors (3 fixed, 0 remaining).

ruff-format..............................................................Failed
- hook id: ruff-format
- files were modified by this hook

173 files reformatted, 207 files left unchanged

Disallow '_' in Markdown filenames.......................................Failed
- hook id: no-underscore-md
- exit code: 1

[pre-commit] ERROR: Found Markdown files with underscores:

Expected behavior

I expect the tests to pass and the pre-commit hooks to succeed as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions