mayankshriv opened a new pull request, #18361:
URL: https://github.com/apache/pinot/pull/18361

   ## Summary
   - Rename `/precommit` skill to `/lint` and expand with `-Xlint:all` compiler
     checks to catch deprecated API usage, unchecked casts, raw types, and other
     warnings — scoped to changed files only
   - Add CLAUDE.md instruction prohibiting use of deprecated APIs, so Claude
     avoids them proactively during code generation
   - Add structured summary report showing status of each check, what was
     auto-fixed, and what needs manual action
   - Update CLAUDE.md pre-commit section to reference `/lint`
   
   ## Motivation
   Generated code was using deprecated APIs from both Pinot internal modules and
   third-party jars, which went undetected because the pre-commit skill only
   checked formatting, license headers, and checkstyle. This adds two layers of
   defense:
   1. **Proactive** — CLAUDE.md instruction tells Claude to never use deprecated
      APIs when generating code
   2. **Reactive** — `/lint` compiles with `-Xlint:all` and reports any compiler
      warnings in changed files, catching what slips through
   
   Both layers are needed because the CLAUDE.md instruction relies on the 
model's
   training data, which has a knowledge cutoff. APIs deprecated in newer library
   versions (or internal Pinot code deprecated after the cutoff) won't be known
   to the model. The compiler check uses the actual `@Deprecated` annotations
   from the jars on disk, so it catches everything regardless of model 
knowledge.
   
   ## What changed
   - **Renamed** `.claude/skills/precommit/` → `.claude/skills/lint/`
   - **Added step 5**: `./mvnw test-compile -pl <modules> -am` with 
`-Xlint:all` —
     single compilation checking both `src/main/` and `src/test/`. No `clean`
     needed — Maven's incremental compilation recompiles changed files, and
     warnings are filtered to changed files via grep. Two layers of scoping
     ensure only new code is flagged.
   - **Added summary report**: table with FIXED/PASS/FAIL per check, auto-fixed
     files, and unfixed issues with file:line
   - **Updated CLAUDE.md**: added deprecated API prohibition to coding 
conventions;
     replaced manual pre-commit commands with `/lint` reference
   
   ## Auto-fix scope
   Only formatting (spotless) and license headers are auto-fixed — these are
   mechanical, deterministic changes. Everything else is report-only:
   - Checkstyle violations: reported with file:line, user must fix
   - Compiler warnings (deprecation, unchecked, etc.): reported with file:line
     and the warning message. Never auto-fixed or suppressed with
     `@SuppressWarnings`
   
   ## Test plan
   - [x] Run `/lint` on a module with clean code — all checks pass, summary 
prints
   - [x] Introduce a deprecated API call — verified compiler catches it
     (`DataSchemaTest.java:37 [deprecation] getTransformFunction()`)
   - [x] Confirmed `test-compile` is needed (not `compile`) to check test 
sources
   - [x] Verified CLAUDE.md references updated
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to