Skip to content

[Infrastructure,Scripts] Add more pre-commit hooks - #18232

Open
vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:hooks
Open

vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:hooks

Conversation

@vkucera

@vkucera vkucera commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds more pre-commit hooks

  • to cover more pathological commit scenarios and more file types,
  • and to provide the possibility to run more of the CI checks locally so that users have the option to preview what the CI would report on their PR before they make it and to have the option to fix the found issues even before making a commit.

Hook versions are pinned to commit hashes in the source repositories to prevent danger from malicious manipulation of tags.

Hooks:

  • check-added-large-files (Checks the file size. (max 500 kB))
  • check-ast (Checks Python syntax.)
  • check-case-conflict (Checks for file name conflicts on macOS.)
  • check-executables-have-shebangs (Checks shebangs in non-binary executables.)
  • check-merge-conflict (Checks for merge conflict strings.)
  • check-symlinks (Checks for invalid symlinks.)
  • check-yaml (Checks YAML syntax.)
  • end-of-file-fixer (Makes sure files end in a single newline.)
  • trailing-whitespace (Trims trailing whitespace.)
  • shellcheck (Finds bugs in shell scripts. Included in MegaLinter.)
  • ruff (check + format) (Linter for Python scripts. Included in MegaLinter.)
  • format-includes (Fixes include format. Included in the formatting CI check.)
    • Ports the awk script to a Python script, providing several benefits:
      • Preserves spacing after includes.
      • Preserves execution flags.
      • Directly formats the input files.
  • O2 linter (This PR makes the script executable.)

Comments:

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 0 warnings, 🔕 0 disabled

@github-actions github-actions Bot changed the title Add more pre-commit hooks [Infrastructure,Scripts] Add more pre-commit hooks Oct 9, 2026
@vkucera
vkucera marked this pull request as ready for review October 9, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant