4.1 Excluding Lines
4.2 Excluding Files
4.2.2. Default Excludes
4.2.3. Manually Excluding
4.2.4. via ecrc
4.2.5. via arguments
This is a tool to check if your files consider your
Most tools - like linters for example - only test one filetype and need an extra configuration.
This tool only needs your
.editorconfig to check all files.
If you don't know about editorconfig already you can read about it here: editorconfig.org.
Currently implemented editorconfig features are:
Unsupported features are:
Grab a binary from the release page.
If you have go installed you can run
go get github.com/editorconfig-checker/editorconfig-checker and run
make build inside the project folder.
This will place a binary called
ec into the
USAGE: -e string a regex which files should be excluded from checking - needs to be a valid regular expression -exclude string a regex which files should be excluded from checking - needs to be a valid regular expression -h print the help -help print the help -i ignore default excludes -ignore ignore default excludes -v print debugging information -verbose print debugging information -version print the version number
If you run this tool from a repository root it will check all files which are added to the git repository and are text files. If the tool isn't able to determine a file type it will be added to be checked too.
If you run this tool from a normal directory it will check all files which are text files. If the tool isn't able to determine a file type it will be added to be checked too.
You can exclude single lines inline. To do that you need a comment on that line that says:
const myTemplateString = ` first line wrongly indended line because it needs to be` // editorconfig-checker-disable-line
If you want to exclude a file inline you need a comment on the first line of the file that contains:
-- editorconfig-checker-disable-file add :: Int -> Int -> Int add x y = let result = x + y -- falsy indentation would not report in result -- falsy indentation would not report
If you don't pass the
ignore flag to the binary these files are excluded automatically:
"yarn\\.lock$", "package-lock\\.json", "composer\\.lock$", "\\.snap$", "\\.otf$", "\\.woff$", "\\.woff2$", "\\.eot$", "\\.ttf$", "\\.gif$", "\\.png$", "\\.jpg$", "\\.jepg$", "\\.mp4$", "\\.wmv$", "\\.svg$", "\\.ico$", "\\.bak$", "\\.bin$", "\\.pdf$", "\\.zip$", "\\.gz$", "\\.tar$", "\\.7z$", "\\.bz2$", "\\.log$", "\\.css\\.map$", "\\.js\\.map$", "min\\.css$", "min\\.js$"
You can create a file called
.ecrc where you can put a regular expression on each line which files should be excluded. If you do this it will be merged with the default excludes.
Remember to escape your regular expressions correctly. :)
.ecrc can look like this:
LICENSE$ slick-styles\.vanilla-css$ banner\.js$ react_crop\.vanilla-css$ vanilla Resources/Public/Plugins README\.md$
If you want to play around how the tool would behave you can also pass the
--exclude|-e argument to the binary. This will accept a regular expression as well. If you use this argument the default excludes as well as the excludes from the
.ecrc-file will merged together.
ec --exclude node_modules
Every exclude option is merged together.
If you have any questions, suggestions, need a wrapper for a programming language or just want to chat join #editorconfig-checker on freenode(IRC). If you don't have an IRC-client set up you can use the freenode webchat.