Skip to content
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

How to ignore a specific file or file pattern ? #497

Closed
miguno opened this issue Oct 25, 2024 · 1 comment
Closed

How to ignore a specific file or file pattern ? #497

miguno opened this issue Oct 25, 2024 · 1 comment

Comments

@miguno
Copy link

miguno commented Oct 25, 2024

First, thanks for your work on this!

My question: How can I ignore a specific file or particular file pattern? Is this supported?

Prior issues

I only found an older discussion #11 from 2014, but rubycritic has progressed since—such as supporting a .rubycritic.yml config file.

Background

Imagine this .rubycritic.yml file:

minimum_score: 95
paths:
  - "app/"
  - "db/"      # <=== entire db/ folder is included
  - "config/"
  - "lib/"
  - "script/"

Here, how can I exclude a specific file such as db/queue_schema.rb?

Think:

# Not supported, just to get the idea across.
exclude_paths:
  - "db/queue_schema.rb"
@etagwerker
Copy link
Collaborator

@miguno At the moment the only way to do this is to pass directories to the rubycritic command.

It could be something like this:

rubycritic app lib

Then it will only analyze files in those directories.

There is already an issue related to the configuration file over here (#30) -- so I'm going to close this as a duplicate. Feel free to comment on #30 or submit a PR with an initial implementation of a configuration file. 👍🏼

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

No branches or pull requests

2 participants