CFLint
CFLint copied to clipboard
Implement scanning exclude mechanism on folder level
.cflintrc can block out linting on certain dirs by not including any rules.
But there should be a mechanism to block CFLint from even going into certain directories. An example would be huge asset structures with 1000s of files or subdirectories. No need to scan all those files for the supported extensions if the user already knows this is a waste of time and CPU resources.
Can we have a discussion if this is useful and how we'd support it, @KamasamaK @ryaneberly ?
Agreed. Could we simply ignore all 'hidden' folders by default (folders that start with a period)?
Yeah, I think that's even better than my solution with .git, .hg and .svn. CFLint has no business in those kind of folders.
What about something in the vein of .gitignore
, .eslintignore
, .tslintignore
, etc. that allows ignoring globs?
Basically the file would (have to) live in your "scanning root" ?
Yes, that would be the idea. I suppose it could also be a command line argument if you wanted to use one from another location.
I'd be fine with a single file in the scanning root. What I wouldn't want to have to support (I think git/hg can do that) at this stage is nested .cflintignore files and building a precedence chain and complications around that.
That seems fine. .eslintignore
is handled that way.
eslint uses the parameter --no-ignore to disable the ignore. For simpilicity we could hardcode out all .folders and support that parm. .cflintignore could be a future enhancement
I would go along the lines of @KamasamaK that if there is a .gitignore read it and ignore its patterns, almost all the time this file dictates code that is not in your source control (dependencies, libraries, etc). This is a big start. The next one is a configuration param in the current .cflintrc
Why not include another key for folder/file patterns to ignore.
This would be great. VS Code crawls every time i do a box install as it scans everything again :(
@TheRealAgentK I think I have a prototype working. Borrowed the .gitignore parser from jgit.
https://github.com/cflint/CFLint/commit/073a4b92284bca49181cb42b2b5f7e4a8ae009f0
moving to 1.6.0
Having a .cflintingnore file would be awesome! I am trying to find a way to just ignore one file (that has includes that everyone includes so parsing crawls) would be awesome.
@cybersonic If you're using Sublime Text, it's possible to get tricky with the exclude patterns. I did a bit of an exploration to see if I could make SublimeLinter call CFLint only when wanted. https://www.youtube.com/watch?v=rl44og2sblE&t=2s