Skip to content

Don't lint any git-ignored files #1718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 10, 2025
Merged

Conversation

alexeyr-ci2
Copy link
Collaborator

@alexeyr-ci2 alexeyr-ci2 commented Mar 27, 2025

Summary

Avoid linting any files in .gitignore to speed up.

Pull Request checklist

  • [ ] Add/update test to cover these changes
  • [ ] Update documentation
  • [ ] Update CHANGELOG file

This change is Reviewable

Summary by CodeRabbit

  • Chores
    • Enhanced the linting configuration by integrating the .gitignore file and refining file ignore patterns for a more consistent development environment.
    • Updated internal dependency management by adding a new compatibility package.
    • Improved cleanup routines for dependency removal during conversion processes.
    • Expanded the .gitignore file to include additional patterns for ignored files and directories, focusing on temporary files and ReScript build artifacts.
    • Removed an outdated ignore file that previously specified rules for ignored files in a dummy application.

Copy link
Contributor

coderabbitai bot commented Mar 27, 2025

Walkthrough

This pull request updates the ESLint configuration and related dependency handling. In the ESLint config file, two new import statements were added, and the configuration now integrates the project’s .gitignore file via the includeIgnoreFile function. Additionally, the ignored file patterns have been simplified. In the package.json, a new devDependency (@eslint/compat at version ^1.2.7) was introduced. The conversion script was also updated to remove the @eslint/compat entry from package.json. Changes were made to the .gitignore file to expand the ignored files and directories, while a redundant .gitignore file in the dummy spec directory was deleted.

Changes

Files Change Summary
eslint.config.ts Added imports for node:path and @eslint/compat; invoked includeIgnoreFile with the .gitignore file; simplified patterns in globalIgnores.
package.json, script/convert Added @eslint/compat (^1.2.7) to devDependencies; updated script to remove the @eslint/compat entry from the package.json file.
.gitignore Modified existing patterns and added new entries for ignored files and directories, including temporary files and ReScript build artifacts.
spec/dummy/.gitignore Deleted file that contained rules for ignoring specific files and directories.

Possibly related PRs

  • Detect dead code and unused dependencies #1687: The changes in the main PR, specifically the modifications to the ESLint configuration in eslint.config.ts, are related to the changes in the retrieved PR, which also involves updates to ESLint configuration in .eslintrc, indicating a direct connection in the context of ESLint setup.

Suggested reviewers

  • Judahmeek

Poem

Hop, skip, and code along,
A new config dance, so swift and strong.
I’ve tucked my .gitignore in tight,
Simplified paths that shine so bright.
With dependencies pruned in a neat little hop,
This rabbit cheers—code will never stop!


📜 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 783e987 and 460b773.

📒 Files selected for processing (3)
  • .gitignore (4 hunks)
  • eslint.config.ts (3 hunks)
  • spec/dummy/.gitignore (0 hunks)
💤 Files with no reviewable changes (1)
  • spec/dummy/.gitignore
🚧 Files skipped from review as they are similar to previous changes (2)
  • eslint.config.ts
  • .gitignore
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: dummy-app-integration-tests (oldest)
  • GitHub Check: dummy-app-integration-tests (newest)
  • GitHub Check: rspec-package-tests (newest)
  • GitHub Check: rspec-package-tests (oldest)
  • GitHub Check: build

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@alexeyr-ci alexeyr-ci force-pushed the alexeyr/eslint-gitignore branch 2 times, most recently from 55f8ebc to 3443913 Compare March 27, 2025 16:42
@alexeyr-ci alexeyr-ci force-pushed the alexeyr/eslint-gitignore branch from 3443913 to da03ba6 Compare April 7, 2025 17:04
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.gitignore (2)

15-16: Review Duplicate tmp Directory Patterns
The file now contains both /tmp/ (line 8) and tmp/ (line 15). While this may be intentional to cover temporary directories at different levels, it’s worth verifying if both patterns are needed or if they can be consolidated to avoid redundancy.


45-45: Minor Formatting Adjustment
The change on this line appears to be a formatting or whitespace adjustment. Ensure that the file maintains consistent formatting throughout.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3443913 and da03ba6.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • .gitignore (4 hunks)
  • eslint.config.ts (3 hunks)
  • package.json (1 hunks)
  • script/convert (1 hunks)
  • spec/dummy/.gitignore (0 hunks)
💤 Files with no reviewable changes (1)
  • spec/dummy/.gitignore
🚧 Files skipped from review as they are similar to previous changes (3)
  • package.json
  • script/convert
  • eslint.config.ts
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: dummy-app-integration-tests (newest)
  • GitHub Check: dummy-app-integration-tests (oldest)
  • GitHub Check: build
  • GitHub Check: rspec-package-tests (oldest)
  • GitHub Check: rspec-package-tests (newest)
🔇 Additional comments (6)
.gitignore (6)

1-1: Refined .bundle Pattern Scope
The change from an anchored pattern (likely /.bundle/) to .bundle/ now ignores any directory named .bundle regardless of its location in the repository. This is in line with the PR objective of excluding git-ignored files to improve linting performance.


4-4: Broadening the coverage Directory Ignore
Changing the pattern to coverage/ ensures that any directory named "coverage"—no matter where it appears—is ignored. This better covers various coverage output locations and helps speed up lint operations.


28-28: Updated Yarn Integrity Ignore
The modified pattern .yarn-integrity will ignore the file consistently across environments. Confirm that this meets your intended directory structure and build setup.


46-54: Consolidated Dummy App Ignore Rules
Integrating the dummy app ignore patterns directly into the main .gitignore streamlines the rules and removes redundancy (notably eliminating the separate spec/dummy/.gitignore). The inclusion of specific exceptions like !/spec/dummy/log/.keep is well-managed.


55-60: Addition of ReScript Build Files Ignore Patterns
These new entries for ReScript build artifacts (e.g., .merlin, lib/bs/, .bsb.lock, *.res.js) ensure that generated files from the build process are skipped during linting, which should further improve overall performance.


61-62: Excluding Generated Files from Linting
The ignore rule for files/folders labeled as generated (tagged with “Generated by ROR FS-based Registry”) is a good addition to prevent unnecessary linting. This aligns with best practices for excluding auto-generated content.

@alexeyr-ci alexeyr-ci force-pushed the alexeyr/eslint-gitignore branch from da03ba6 to 783e987 Compare April 7, 2025 17:10
@alexeyr-ci alexeyr-ci force-pushed the alexeyr/eslint-gitignore branch from 783e987 to 460b773 Compare April 7, 2025 17:16
@alexeyr-ci2 alexeyr-ci2 merged commit 12c11ae into master Apr 10, 2025
11 checks passed
@alexeyr-ci2 alexeyr-ci2 deleted the alexeyr/eslint-gitignore branch April 10, 2025 07:06
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.

3 participants