Skip to content

Do not run lint-stage on files that are outside the scope of lint actions#6151

Merged
Amxx merged 1 commit intoOpenZeppelin:masterfrom
Amxx:CI/run-lint-stage-on-contracts-and-tests
Nov 27, 2025
Merged

Do not run lint-stage on files that are outside the scope of lint actions#6151
Amxx merged 1 commit intoOpenZeppelin:masterfrom
Amxx:CI/run-lint-stage-on-contracts-and-tests

Conversation

@Amxx
Copy link
Collaborator

@Amxx Amxx commented Nov 27, 2025

Fixes #????

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@Amxx Amxx requested a review from james-toussaint November 27, 2025 09:35
@Amxx Amxx requested a review from a team as a code owner November 27, 2025 09:35
@changeset-bot
Copy link

changeset-bot bot commented Nov 27, 2025

⚠️ No Changeset found

Latest commit: 5438219

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Amxx Amxx added this to the 5.6 milestone Nov 27, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

Walkthrough

The lint-staged configuration in package.json is updated to modify file matching patterns used during pre-commit hooks. The JavaScript/TypeScript file pattern is broadened from *.{js,ts} to **/*.{js,ts} to include files in nested directories. The Solidity file pattern is adjusted from *.sol to {contracts,test}/**/*.sol, targeting files specifically within the contracts and test directories recursively. These changes alter the scope of which files undergo linting and formatting during pre-commit operations.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is a template with a placeholder issue reference and unchecked checklist items, but it does not provide specific information about the changes made. Fill in the PR description with details about why lint-staged patterns were modified and what specific files are now included or excluded from linting.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: restricting lint-staged to only run on files within the intended scope (contracts and tests), which aligns with the glob pattern updates in package.json.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03666bd and 5438219.

📒 Files selected for processing (1)
  • package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-04T09:13:21.278Z
Learnt from: Amxx
Repo: OpenZeppelin/openzeppelin-contracts PR: 5904
File: contracts/crosschain/ERC7786Recipient.sol:3-3
Timestamp: 2025-09-04T09:13:21.278Z
Learning: In OpenZeppelin contracts, hardhat.config.js uses yargs to configure the Solidity compiler version dynamically via command line arguments, with a default of '0.8.27' set on line 21 and the solidity configuration using argv.compile around lines 76-87, rather than hardcoded version strings.

Applied to files:

  • package.json
📚 Learning: 2025-09-04T09:13:21.278Z
Learnt from: Amxx
Repo: OpenZeppelin/openzeppelin-contracts PR: 5904
File: contracts/crosschain/ERC7786Recipient.sol:3-3
Timestamp: 2025-09-04T09:13:21.278Z
Learning: In OpenZeppelin contracts, hardhat.config.js uses a sophisticated yargs-based configuration where the Solidity compiler version is set via argv.compiler (line 77) with a default of '0.8.27' defined in the yargs options (line 21), allowing flexible command-line overrides while maintaining a consistent default.

Applied to files:

  • package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Redirect rules - solidity-contracts
  • GitHub Check: Header rules - solidity-contracts
  • GitHub Check: Pages changed - solidity-contracts
  • GitHub Check: slither
  • GitHub Check: coverage
  • GitHub Check: tests-foundry
  • GitHub Check: tests
  • GitHub Check: tests-upgradeable
  • GitHub Check: halmos
🔇 Additional comments (1)
package.json (1)

98-105: Align lint-staged patterns with lint script definitions.

The lint-staged configuration now matches the patterns used in the manual lint scripts (lint:js and lint:sol on lines 20–23), ensuring consistency between pre-commit hooks and the full lint workflow.

Changes look correct:

  • **/*.{js,ts} expands coverage to nested directories (matching line 20's lint:js pattern)
  • {contracts,test}/**/*.sol restricts Solidity to those directories specifically (matching line 22's lint:sol pattern)

Files excluded by .gitignore will be automatically filtered via the --ignore-path flag.

To confirm the changes work as intended, please verify:

  1. Pre-commit hooks only lint files that would be included in manual npm run lint execution
  2. No unexpected files are being linted or skipped during commit (you may test by staging a file and running npx lint-staged --debug)
  3. Solidity files in directories outside contracts/ and test/ (if any) are correctly excluded

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Collaborator

@james-toussaint james-toussaint left a comment

Choose a reason for hiding this comment

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

Thank you.

@Amxx Amxx merged commit d0131a9 into OpenZeppelin:master Nov 27, 2025
25 of 26 checks passed
@Amxx Amxx deleted the CI/run-lint-stage-on-contracts-and-tests branch November 27, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants