Open tajmone opened 3 years ago
This is an alternative tool to EditorConfig, worth looking into it:
The overall philosophy is quite different. It seems to work with a set of predefined languages, but it's also extensible.
This is not just and editor/IDE setter, it's an actual code linter. But it can also be used just for code styles validation (--check
option).
Need to look into it with more time at hand...
NOTE ā Also a Node.js app! š
I've come across some new EditorConfig validators (didn't yet test all of them):
Seems to be able to check for code consistency and even enforce it as a linter.
This is an interesting tool (written in Go but also available via NPM) which I've following for over a year:
The problem is that it's not yet production ready, due to some bugs. Last time I tested it (April 2012) I found a Windows bug which won't allow us to use it right now ā see: editorconfig-checker/editorconfig-checker#164
Also, it doesn't yet support encoding validation, which is a pity (at least UTF-8 validation would be nice).
But I'm confident that within less than a year this tool will be stable and usable. Since it's written in Go, you can download pre-compiled binaries, without having to use NPM and Node.js, which is an added bonus.
Another thing that I like about this tool is that it allows overriding some of the settings in .editorconfig
and even introduces new settings especially for validation tasks ā but I haven't used it as much as EClint, so I'm speaking from first impressions.
There's also a GitHub Action to validate project using this tools:
The bug mentioned in editorconfig-checker/editorconfig-checker#164, which fails the build under Windows when no EOL type is specified, seems to have been fixed in October 13, 2021, with PR editorconfig-checker/editorconfig-checker#184, but the fix is not yet available in the current NPM tool.
The fix is mentioned in release 2.4.0 of the Go binary.
The NPM package is lagging behind the latest wrapper, it's still using core v2.3.5:
$ ec -version
2.3.5
So, until the NPM package is update to use core v2.4.0 we won't be able to use the tool in our repositories.
The editorconfig-checker bug-fix was released in 2021-10, but six months have elapsed since and the NPM package hasn't been updated accordingly. Doesn't seem like the NPM package can be relied upon ā it doesn't look to be actively maintained at all.
EClint can't be relied upon either, since it's buggy and no longer maintained.
What are the viable alternatives then?
All I can think of is attempting to create a Ruby gem that downloads the latest Editorconfig-Checker precompiled binary and wraps it around a useful command for validating repositories. But the we would have to maintain the Gem.
Other than that, we could ask end users to download the Editorconfig-Checker binaries ā maybe there's Chocolatey Package for this? but a Ruby gem would be better since it would ensure the binaries are updated (at least whenever we discover a bug or there's a new feature we need), also we could provide some custom options via Ruby to filter results for Git specific needs ā e.g. excluding from the validation (or report) any files ignored by Git, or to focus-on/filter only the files affected by a specific commit (for PRs validation).
We really need to find an alternative tool to EClint to validate code styles consistency of the repo's code, for the following reasons:
Of the above, point 3 is particularly relevant, for it would be ideal to find a code validation tool that uses its own settings file instead of the
.editorconfig
settings, so that we could decouple it from the EditorConifg rules, which don't always match the validation criteria.@thoni56, any ideas if there are any code validation tools in the wild that meet these criteria? Possibly, in standalone binary format.