codeclimate / codeclimate-grep

MIT License
2 stars 4 forks source link

Checking file-naming convention #8

Open FieryCod opened 7 years ago

FieryCod commented 7 years ago

I'm having an issue understanding whereas codeclimate-grep is capable of checking file naming conventions. What I want to achieve is to check whether a file name foo_bar.js is written in kebab-case. AFAIK codeclimate-grep is only searching for patterns inside a file and is unable to check the file name am I right?

pointlessone commented 7 years ago

Hi Karol,

Unfortunately, this engine is designed to only check files content.

Nonetheless, I think it's possible to "hack" it to do what you want but it's not a supported use case.

Try this config:

patterns:
  kebab:
    pattern: .*
    annotation: "Don't use _ in file names"
    severity: minor
    categories: Bug Risk
    path_patterns:
      - "**/*_*"