oxsecurity / megalinter

🦙 MegaLinter analyzes 50 languages, 22 formats, 21 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
https://megalinter.io
GNU Affero General Public License v3.0
1.89k stars 232 forks source link

TSQLLint Update #697

Closed jberkers42 closed 3 years ago

jberkers42 commented 3 years ago

Hey There,

Wasn't sure whether to raise a new feature request, or what exactly.

I was checking on the tsqllint project whether any progress had been made towards supporting Alpine linux without requiring compat libraries.

It seems that the tool was recently updated to support .NET version 5.0, and it's primary deployment method changed from node_module to .NET Tool. It is now installed using:

dotnet tool install tsqllint

In any case, I thought I would try it out in the current build of the mega-linter:v4 docker image, and it seems to run fine.

When you have time, no urgency, it might now be feasible to add it to the general mega-linter image as well using this mechanism instead of the npm install method.

Steps to install as follows:

jberkers$ docker run -ti --entrypoint "" -v $(pwd):/build nvuillam/mega-linter:v4 /bin/bash
bash-5.1# dotnet tool install tsqllint -g
You can invoke the tool using the following command: tsqllint
Tool 'tsqllint' (version '1.13.5') was successfully installed.
bash-5.1# tsqllint --version
Running TSQLLint.
v1.13.5.0
bash-5.1# tsqllint --help
Running TSQLLint.

tsqllint [options] [file.sql] | [dir] | [file.sql | dir]

  -c, --config          Used to specify a .tsqllintrc file path other than the 
                        default
  -f, --force           Used to force generation of default config file when 
                        one already exists
  -i, --init            Generate default .tsqllintrc config file
  -p, --print-config    Print path to config file
  -l, --list-plugins    List the loaded plugins
  -v, --version         Display tsqllint version
  -h, --help            Display this help dialog

I also tried linting some files, both with and without "errors", and had success there also.

Please let me know if you have any questions/comments.

Regards, JohnB

nvuillam commented 3 years ago

Are there differences between the dotnet installed version and the npm one ?

As dotnet is quite heavy, i would like to avoid to install it on all flavors, so the current implementation fits with that wish ^^

jberkers42 commented 3 years ago

It is looking like the NPM version is now locked at 1.11 (as in, no longer developed), but that's just a feeling I get. Since there has been no response on the issue you raised, I am not sure what the plans are overall.

The main change is that this should now be able to run in the "all" flavor, however, since dotnet is not part of the JavaScript flavor, it would likely need to be dropped from that. Given the dotnet flavor includes dotnet, it should work fine there on the newer version.

I get that dotnet is heavy, so this is not suitable for all flavors.

nvuillam commented 3 years ago

@jberkers42 I hear you, I made an attempt in PR #699 , let's see what the CI says :)

The only downside is that javascript flavor will not contain it anymore (i don't want to increase the size one of the most used MegaLinter flavor for a rare use case), so projects with JS & tqsl will have to use main flavor

nvuillam commented 3 years ago

@jberkers42 it seems it works, thanks a lot for the suggestion :)

jberkers42 commented 3 years ago

Thanks once again for the quick response.