Skip to content

chore: add Checks workflow and enhance pre-commit hooks to match cuOpt OSS standards - #63

Merged
ramakrishnap-nv merged 5 commits into
mainfrom
chore/enhance-pre-commit-hooks
Jul 30, 2026
Merged

chore: add Checks workflow and enhance pre-commit hooks to match cuOpt OSS standards#63
ramakrishnap-nv merged 5 commits into
mainfrom
chore/enhance-pre-commit-hooks

Conversation

@ramakrishnap-nv

@ramakrishnap-nv ramakrishnap-nv commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a dedicated Checks workflow (.github/workflows/checks.yml) modelled on cuOpt's check-style pattern, and expands the pre-commit hook suite to match cuOpt OSS standards.

New workflow — checks.yml

Runs pre-commit run --all-files --show-diff-on-failure on every push to main and every PR, with pre-commit environment caching keyed on .pre-commit-config.yaml. Job is named check-style to match cuOpt.

New pre-commit hooks

Hook Version Purpose
check-builtin-literals, check-executables-have-shebangs, check-json, check-yaml pre-commit-hooks v5.0.0 File hygiene
shellcheck v0.10.0.1 Lint ci/utils/*.sh
yamllint v1.38.0 Lint GitHub Actions YAML
zizmor v1.24.1 GitHub Actions security — flags high-severity findings (unpinned actions, etc.)
validate-skills (local) Runs ci/utils/validate_skills.sh on skills/plugin changes

Also in this PR

  • Pin all GitHub Actions to commit SHAs — satisfies NVIDIA security policy; zizmor enforces this on every future commit
  • Remove duplicate lint job from pr.yaml (covered by checks.yml); rename main.yml linttest
  • Fix pre-existing hook failures — trailing whitespace and missing newlines across README, CHANGELOG, issue templates, notebooks, and diagrams; ruff auto-fixes across notebooks
  • CONTRIBUTING.md — replace black/isort/flake8 with ruff; add pre-commit usage instructions (manual run, staged-only run, description of what each hook covers)
  • SPDX header on .pre-commit-config.yaml and checks.yml
  • Global exclude for skill.oms.sig, skill-card.md, BENCHMARK.md
  • Add nvskills-ci/ to .gitignore

Not included (follow-up)

  • sync-skills-version local hook — commented out pending VERSION file
  • rapidsai/verify-copyright — requires adding SPDX headers to workflow YAML files

Test plan

  • pre-commit run --all-files passes locally (verified)
  • Checks / check-style CI job passes on this PR

🤖 Generated with Claude Code

Adds hooks aligned with the cuOpt .pre-commit-config.yaml:

New hooks:
- check-builtin-literals, check-executables-have-shebangs,
  check-json, check-yaml — standard file hygiene
- shellcheck (v0.10.0.1) — lint ci/utils/*.sh scripts
- yamllint (v1.38.0) — lint GitHub Actions YAML files
- zizmor (v1.24.1) — GitHub Actions security audit;
  flags only high-severity findings (unpinned actions, etc.)
- validate-skills local hook — wired to ci/utils/validate_skills.sh

Also:
- Add SPDX license header to .pre-commit-config.yaml
- Add global exclude for skills sig/card/benchmark files
- Pin all GitHub Actions to commit SHAs (required by NVIDIA policy
  and caught by zizmor); keep version tag as inline comment
- Add zizmor ignore on NVIDIA/skills reusable workflow (internal)
- Add pyproject.toml per-file-ignores for demo/ and brev/ notebooks
  (pre-existing E402/F841 in interactive code)

Note: sync-skills-version local hook is commented out pending
creation of the VERSION file.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@ramakrishnap-nv
ramakrishnap-nv requested a review from a team as a code owner July 30, 2026 20:12
@ramakrishnap-nv
ramakrishnap-nv requested review from jgoldberg-nvidia and tmckayus and removed request for a team July 30, 2026 20:12
ramakrishnap-nv and others added 2 commits July 30, 2026 15:21
The project uses ruff for both formatting and linting, not black,
isort, or flake8. Updated all references and code examples.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Add .github/workflows/pre-commit.yml — a dedicated style-check job
modelled on cuOpt's check-style pattern. It runs pre-commit run
--all-files on every push to main and every PR, with pre-commit
environment caching keyed on .pre-commit-config.yaml.

Now that pre-commit covers ruff format, ruff check, shellcheck,
yamllint, zizmor, and validate-skills:
- Remove duplicate lint steps (ruff format/check) from pr.yaml
- Remove duplicate lint job from main.yml; rename to 'test' (pytest only)
- Update pr-builder to no longer depend on the removed lint job

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Rename .github/workflows/pre-commit.yml → checks.yml
- Rename workflow to "Checks" and job to "check-style" (matches cuOpt pattern)
- Apply pre-commit auto-fixes to pre-existing issues caught by new hooks:
  trailing whitespace in README.md, CHANGELOG.md, LICENSE-3rd-party.txt,
  .github/ templates and issue forms; missing newlines in src/readme.md,
  notebooks/readme.md, demo/diagrams/arch_diagram.svg, .gitignore;
  ruff format/check fixes across notebooks and src
- Add nvskills-ci/ to .gitignore (cloned repo for separate PR work)
- Expand pre-commit section in CONTRIBUTING.md: add manual run instructions
  and describe what each hook covers

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@ramakrishnap-nv
ramakrishnap-nv requested a review from a team as a code owner July 30, 2026 20:43
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@ramakrishnap-nv ramakrishnap-nv changed the title chore: enhance pre-commit hooks to match cuOpt OSS standards chore: add Checks workflow and enhance pre-commit hooks to match cuOpt OSS standards Jul 30, 2026
@ramakrishnap-nv
ramakrishnap-nv merged commit 1a53ff3 into main Jul 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants