phinder icon indicating copy to clipboard operation
phinder copied to clipboard

Feature to exclude files / directories from analysis

Open akito19 opened this issue 7 years ago • 4 comments

I seem that Phinder hasn't excluded files and directories, for example /vendor directory, from analyses. Phinder will be more useful if users can adjust analysis targets in detail.

In case of Querly, check feature can control files and directories.

What do you think about it?

akito19 avatar Jan 23 '19 02:01 akito19

I agree with your idea. I will check the Querly's way first (since I don't know it well) and then propose Phinder's way here before implementing the feature!

tomokinakamaru avatar Jan 23 '19 05:01 tomokinakamaru

@akito19 Sorry for keeping you waiting.

I am planning to achieve the exclusion feature by adding ignore key into phinder.yml as follows:

rule:
  ...
ignore:
  - vendor
  ...

Each element in ignore works as the same as a line of .gitignore.

Querly seems to support more complex configurations such as rule-id filtering. But for the first step in Phinder, I am planning to support only exclusion configuration feature. Does this match your need?

tomokinakamaru avatar Feb 06 '19 01:02 tomokinakamaru

In my opinion, the exclude (or include) pattern syntax should be attached to each rule. Perhaps, Goodcheck or RuboCop ways are good for us.

Goodcheck

  - id: com.example.github
    pattern: Github
    message: |
      GitHub is GitHub, not Github

      You may misspelling the name of the service!
    justification:
      - When you mean a service different from GitHub
      - When GitHub is renamed
    glob:
      - app/views/**/*.html.slim
      - config/locales/**/*.yaml

RuboCop

Bundler/DuplicatedGem:
  Enabled: true
  Include:
    - '**/*.gemfile'
    - '**/Gemfile'
    - '**/gems.rb'

wata727 avatar Feb 06 '19 10:02 wata727

I agree with the proposal from @wata727. I will implement the per-rule exclusion/inclusion feature and notify you when it's done!

tomokinakamaru avatar Feb 12 '19 15:02 tomokinakamaru