You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add .copyrightignore and align make format/lint with pre-commit (#107)
## Summary
- **`make lint` was failing** because the copyright fixer had no
exclusion list for community markdown files (`README.md`,
`CHANGELOG.md`, etc.) and dot-config directories (`.agent/`, `.claude/`,
`.cursor/`, `.github/`). Pre-commit worked because it runs in fix mode,
silently adding headers rather than failing.
- **Adds `.copyrightignore`** — a gitignore-style file at the repo root
where exclusions are declared. Supports bare filenames (`README.md`),
directory patterns (`.github/`), and path globs. No Python code changes
needed to add future exclusions.
- **Aligns `make format` / `make lint` / pre-commit** so they use the
same fixers with the same scope:
- `make format` now mutates (ruff format + full ruff check --fix +
copyright fix on whole repo) — same behavior as pre-commit.
- `make lint` is now read-only (ruff check without --fix, ty check,
copyright --check) — safe for CI.
- Previously `ruff-lint.sh` ran `ruff check --fix`, mutating files in
what should be a check-only command.
- **Adds missing SPDX headers** to 39 project files (docs, tools,
scripts) that were missing them.
Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -293,22 +293,26 @@ Before submitting a PR:
293
293
294
294
### Formatting
295
295
296
-
We use [Ruff](https://docs.astral.sh/ruff/) for code formatting and import sorting. The formatter runs on changed files against the `main` branch.
296
+
We use [Ruff](https://docs.astral.sh/ruff/) for code formatting and linting auto-fix, plus a copyright header fixer. `make format` mutates files — it runs the same fixers as pre-commit.
297
297
298
298
```bash
299
-
# Format codeand sort imports
299
+
# Format code, auto-fix lint issues, and add missing copyright headers
300
300
make format
301
301
```
302
302
303
303
### Linting and Type Checking
304
304
305
-
We use [Ruff](https://docs.astral.sh/ruff/) for linting and [ty](https://github.com/astral-sh/ty) for type checking. Both run on changed files against `main`.
305
+
We use [Ruff](https://docs.astral.sh/ruff/) for linting and [ty](https://github.com/astral-sh/ty) for type checking. `make lint` is read-only — it reports errors without modifying files.
306
306
307
307
```bash
308
-
#Run ruff linter (with auto-fix) and ty type checker
308
+
#Check linting, type errors, and missing copyright headers (no auto-fix)
309
309
make lint
310
310
```
311
311
312
+
### Copyright Headers
313
+
314
+
All source files (`.py`, `.sh`, `.yaml`, `.yml`, `.md`) require SPDX copyright headers. `make format` adds them automatically. Files excluded from this requirement (community files like `README.md`, config directories like `.github/`) are listed in `.copyrightignore` at the repo root.
315
+
312
316
### Pre-commit Hooks
313
317
314
318
We recommend setting up pre-commit hooks to catch formatting, linting, and type issues before committing:
@@ -317,7 +321,7 @@ We recommend setting up pre-commit hooks to catch formatting, linting, and type
317
321
prek install
318
322
```
319
323
320
-
This installs hooks that run Ruff (format + lint), ty type checking, and uv lock verification on each commit.
324
+
This installs hooks that run Ruff (format + lint), copyright header fixer, ty type checking, and uv lock verification on each commit.
0 commit comments