Open tomdavidson opened 7 years ago
Hey Tom. We use glob for the files
property pattern. A run down of the format is here: https://github.com/isaacs/node-glob#glob-primer
It includes excluding files. But I can see how having a dedicated excludeFiles
pattern/array would be useful. We'll look into that.
In the meantime I hope maybe the glob pattern will work for you.
Thank you. I did not realize I could combine excludes with glob. Here is an example of a fnlint.json that is suppose to lint everything except a few md files - incase someone else comes looking:
{
"basePath": ".",
"files": "!(.github|.gitlab|CHANGELOG.md|README.md|CONTRIBUTING.md|node_modules)",
"format": "kebabcase",
"directories": true
}
Shoot. It did not fail, but also did not when it was suppose to on SNAKE_CASE.md.
{
"basePath": ".",
"files": "!(.github|.gitlab|CHANGELOG.md|README.md|CONTRIBUTING.md|node_modules)",
"format": "kebabcase",
"directories": true
}
├── CHANGELOG.md
├── common
├── other
│ ├── fnlint.json
│ ├── lower-case-dash.js
│ ├── only-on-master.sh
│ ├── runners
│ │ └── aio
│ │ └── Dockerfile
│ ├── SNAKE_CASE.md
│ └── tf-lint.sh
├── package.json
└── README.md
$ fnlint -c other/fnlint.json
fnlint kebabcase pass: 2 file(s) linted
Hey Tom... sorry for the delayed reply.
Looks like the pattern you have is only finding 2 files. I think if you update your "files" pattern to something like the following I think you'll get the results you're after:
!(.github|.gitlab|CHANGELOG.md|README.md|CONTRIBUTING.md|node_modules)**/*
Awesome. Thank you. I was able to dict my custom script today. Thank you for your help and for this tool.
!(.github|.gitlab|CHANGELOG.md|README.md|CONTRIBUTING.md|node_modules)|**/*
always passes: !(.github|.gitlab|CHANGELOG.md|README.md|CONTRIBUTING.md|node_modules)|*/
does not lint '.' - basePath is '.' "!(.github|.gitlab|CHANGELOG.md|README.md|CONTRIBUTING.md|node_modules)*/"
does not lint subdirectories "!(.github|.gitlab|CHANGELOG.md|README.md|CONTRIBUTING.md|node_modules)**",
I am not following how commander and the rest works, I think fnlint needs a PR that makes an exclude option to node-glob's ignore.
I am wanting to stitch from name-lint to fnlint, but I am not seeing the option of excluding files. Is this feature available but not documented?