Skip to content

Auto format copyright and add linter#121

Merged
scal444 merged 5 commits intoNVIDIA-Digital-Bio:mainfrom
scal444:copyright_lint
Apr 2, 2026
Merged

Auto format copyright and add linter#121
scal444 merged 5 commits intoNVIDIA-Digital-Bio:mainfrom
scal444:copyright_lint

Conversation

@scal444
Copy link
Copy Markdown
Collaborator

@scal444 scal444 commented Mar 25, 2026

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 25, 2026

Greptile Summary

This PR refactors admin/apply_copyright.sh to support dynamic year detection (via git log), a check-only mode (-d), and year-fix mode (-f), and adds a new copyright-check CI job. It also applies the updated copyright headers across 40+ source files, updating years and adding previously-missing headers.

Several issues from prior review rounds remain open in admin/apply_copyright.sh: the hardcoded 2026 ceiling in get_file_year, find_included_files silently excluding all admin/ scripts (so the new CI job won't enforce headers on them), and write_header's mv discarding the original file's execute bit. Two new P2 concerns are noted inline: Python files are processed with preserve_shebang=false (would misplace shebangs on any future executable .py scripts), and the shebang branch of write_header produces a double blank separator when the original script had a blank line after the shebang.

Confidence Score: 4/5

  • Safe to merge for the copyright-header changes themselves, but the apply_copyright.sh script retains multiple known defects that will need follow-up fixes.
  • Prior review rounds flagged several P1 issues in admin/apply_copyright.sh (hardcoded year ceiling, admin/ directory skipped by CI enforcement, execute-bit loss via mv) that are still present in the current code. Two new P2 issues are identified here. The bulk copyright changes across source files look mechanically correct for the files reviewed. Score of 4 reflects the remaining open items in the tooling rather than any breakage in the library code itself.
  • admin/apply_copyright.sh (multiple logic issues), admin/distribute/verify_conda_distributable.sh and verify_conda_version_combinations.sh (execute bit removed, missing blank-line separator)

Important Files Changed

Filename Overview
admin/apply_copyright.sh Major refactor: adds check-only mode, dynamic year detection via git history, and per-language header functions. Still carries unresolved issues from prior review rounds: hardcoded 2026 ceiling in get_file_year, admin/ directory excluded from find_included_files, write_header uses mv without restoring file permissions, and the shebang path generates a double-blank separator for scripts with blank lines after the shebang.
.github/workflows/lint.yml New copyright-check CI job added. Correctly uses fetch-depth: 0 so git-log year detection has full history; runs apply_copyright.sh -d in check-only mode. Since admin/ is excluded by find_included_files, the CI will not catch missing/wrong headers in admin scripts.
admin/distribute/verify_conda_distributable.sh Copyright header added and mode changed from 100755 to 100644 (execute bit lost); header is missing the blank-line separator between the license block and set -exuo pipefail.
admin/distribute/verify_conda_version_combinations.sh Same as verify_conda_distributable.sh: execute bit dropped (100755 → 100644) and blank-line separator after the license header is missing.
benchmarks/updateInverseHessianBench.cu Copyright header added with correct 2025 year and proper blank-line separator before the first #include; no functional changes.
tests/test_openmp_helpers.cpp Non-SPDX copyright line replaced with full SPDX-compliant header; blank-line separator present before #include; file compiles correctly.

Reviews (4): Last reviewed commit: "Fix more copyrights" | Re-trigger Greptile

@scal444 scal444 requested a review from evasnow1992 March 30, 2026 15:12
@scal444 scal444 changed the title [draft] Auto format copyright and add linter Auto format copyright and add linter Mar 30, 2026
Copy link
Copy Markdown
Collaborator

@evasnow1992 evasnow1992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me.

@scal444 scal444 merged commit 1fcf7a7 into NVIDIA-Digital-Bio:main Apr 2, 2026
4 of 9 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