Skip to content

pre-commit config excludes everything #28

@corneliusroemer

Description

@corneliusroemer

It seems that the current pre-commit config effectively disables pre-commit entirely.

All files are skipped, possibly due to a) a bug in pre-commit or b) wrong exclusion regex.

Repro:

  1. Install pre-commit: pre-commit install
  2. Run on all files: pre-commit run -a
  3. Observe result:
$ pre-commit run -a
sync-pre-commit-deps.................................(no files to check)Skipped
shellcheck...........................................(no files to check)Skipped
Lint GitHub Actions workflow files...................(no files to check)Skipped
trim trailing whitespace.............................(no files to check)Skipped
check python ast.....................................(no files to check)Skipped
check for case conflicts.............................(no files to check)Skipped
check docstring is first.............................(no files to check)Skipped
check json...........................................(no files to check)Skipped
check that executables have shebangs.................(no files to check)Skipped
check for merge conflicts............................(no files to check)Skipped
check that scripts with shebangs are executable......(no files to check)Skipped
check for broken symlinks............................(no files to check)Skipped
check toml...........................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
detect destroyed symlinks............................(no files to check)Skipped
detect private key...................................(no files to check)Skipped
fix end of files.....................................(no files to check)Skipped
fix utf-8 byte order marker..........................(no files to check)Skipped
ruff.................................................(no files to check)Skipped

Commenting out the exclude line leads to the results along the lines of what I'd expect

exclude: '\.(tsv|fasta|gb)$|^ingest/vendored/|'
repos:

 pre-commit run -a
sync-pre-commit-deps.....................................................Passed
shellcheck...............................................................Passed
Lint GitHub Actions workflow files.......................................Passed
trim trailing whitespace.................................................Passed
check python ast.........................................................Passed
check for case conflicts.................................................Passed
check docstring is first.................................................Passed
check json...............................................................Passed
check that executables have shebangs.....................................Failed
- hook id: check-executables-have-shebangs
- exit code: 1

phylogenetic/scripts/assign-colors.py: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x phylogenetic/scripts/assign-colors.py`
  If on Windows, you may also need to: `git add --chmod=-x phylogenetic/scripts/assign-colors.py`
  If it is supposed to be executable, double-check its shebang.

check for merge conflicts................................................Passed
check that scripts with shebangs are executable..........................Passed
check for broken symlinks............................(no files to check)Skipped
check toml...........................................(no files to check)Skipped
check yaml...............................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
fix utf-8 byte order marker..............................................Passed
ruff.....................................................................Failed
- hook id: ruff
- exit code: 1

phylogenetic/scripts/assign-colors.py:42:43: E712 Avoid equality comparisons to `True`; use `if metadata['focal']:` for truth checks
   |
40 |                 assignment[name] = subset_present
41 |             if name in metadata and 'focal' in metadata:
42 |                 focal_list = metadata.loc[metadata['focal'] == True, name].unique()
   |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^ E712
43 |                 subset_focal = [x for x in assignment[name] if x in focal_list]
44 |                 assignment[name] = subset_focal
   |
   = help: Replace with `metadata['focal']`

Found 1 error.
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions