chore: use eslint copyright plugin#250
Conversation
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
📝 WalkthroughWalkthroughUpdates CI checkout shallow depth and adds a git fetch since 2025-12-30; adds an ESLint plugin and devDependency; adds an RPC package re-export index; expands extension activation/deactivation tests; updates many file header copyright years to include 2026. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
0627de7 to
c96ee04
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/extension/src/main.spec.ts (1)
49-49:⚠️ Potential issue | 🟡 MinorCopy-paste comment: "IBM Cloud Extension" should be "Contexts Extension".
Proposed fix
- // Call activate first to initialize IBM Cloud Extension + // Call activate first to initialize Contexts Extension
🧹 Nitpick comments (2)
.github/workflows/pr-check.yaml (1)
39-41:fetch-depth: 0adds full clone overhead to every matrix build.The copyright ESLint plugin likely needs git history, but only the lint step (which runs on all matrix OSes at Line 73) benefits from it. Consider running the linter on a single OS only, or restricting
fetch-depth: 0to the runner that actually executeslint:check, to avoid slowing down Windows and macOS builds unnecessarily.packages/rpc/src/index.ts (1)
19-21: Simplify to a single re-export statement.The separate import and export can be collapsed into a direct re-export.
Proposed change
-import { createRpcChannel, RpcChannel, RpcExtension, RpcBrowser } from './rpc'; - -export { createRpcChannel, RpcChannel, RpcExtension, RpcBrowser }; +export { createRpcChannel, RpcChannel, RpcExtension, RpcBrowser } from './rpc';
52e58c2 to
58477f1
Compare
Signed-off-by: Philippe Martin <phmartin@redhat.com>
58477f1 to
5f1ddae
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/pr-check.yaml:
- Around line 40-41: Update the workflow comment and/or value for the GitHub
Action checkout fetch-depth: currently set to "fetch-depth: 10" in the
.github/workflows/pr-check.yaml step; either increase the numeric cap to a safer
default (e.g., 0 or a larger number) or change the comment to clarify that the
subsequent fetch using --shallow-since will deepen history for PRs with more
than 10 commits so the eslint copyright check will still work; make the change
next to the fetch-depth: 10 line and keep the --shallow-since mention
consistent.
🧹 Nitpick comments (1)
.github/workflows/pr-check.yaml (1)
43-45: Hardcoded date2025-12-30will require annual maintenance.This date will need to be bumped every January to include the previous year's commits. Consider computing it dynamically to avoid silent breakage when someone forgets to update it.
♻️ Suggested dynamic date computation
- name: fetch year's commits and at least one commit of last year, for eslint copyright check run: | - git fetch --shallow-since=2025-12-30 + SINCE_DATE="$(date -d "$(date +%Y)-01-01 -2 days" +%Y-%m-%d)" + git fetch --shallow-since="$SINCE_DATE"This computes a date ~2 days before January 1st of the current year, so it always captures at least one commit from the prior year without manual updates.
Note:
date -dis GNU date syntax (available onubuntu-*runners). On macOS runners this would needdate -vsyntax, but this step only runs in thebuildjob matrix which includes all three OS types. If that's a concern, you could conditionally run this only on Linux or use a cross-platform approach.
| with: | ||
| fetch-depth: 10 # must be at least the number of commits in the PR, for eslint copyright check |
There was a problem hiding this comment.
The fetch-depth: 10 cap could be insufficient for large PRs.
The comment says this must be at least the number of commits in the PR, but PRs can exceed 10 commits. While the subsequent --shallow-since fetch likely compensates by deepening the history, the comment implies a constraint that isn't actually enforced. Consider either raising this value or clarifying the comment to note that the follow-up fetch step handles the deeper history.
🤖 Prompt for AI Agents
In @.github/workflows/pr-check.yaml around lines 40 - 41, Update the workflow
comment and/or value for the GitHub Action checkout fetch-depth: currently set
to "fetch-depth: 10" in the .github/workflows/pr-check.yaml step; either
increase the numeric cap to a safer default (e.g., 0 or a larger number) or
change the comment to clarify that the subsequent fetch using --shallow-since
will deepen history for PRs with more than 10 commits so the eslint copyright
check will still work; make the change next to the fetch-depth: 10 line and keep
the --shallow-since mention consistent.
Uh oh!
There was an error while loading. Please reload this page.