ndmitchell / neil

General tools for Neil
Other
38 stars 16 forks source link

How to specify HLint version when using `travis.sh`? #47

Closed chshersh closed 1 year ago

chshersh commented 4 years ago

Thanks for writing and maintaining the script to run hlint painlessly on Travis CI! We've been enjoying using it a lot in @kowainik. It's quite easy to run the code via hlint on CI using the following command:

curl -sSL https://raw.github.com/ndmitchell/neil/master/misc/travis.sh | sh -s -- hlint src/

If my understanding is correct, this script always uses the latest available version of HLint. I wonder though, is it possible to somehow specify the desired HLint version to run?

The reason for this question is when you return to your project after a month, or if some volunteer contributor opens a PR against your repo, you'll see HLint failures on CI in a code that wasn't even touched in the PR. This can be sometimes annoying to see and fix periodically, especially when I also need to build new hlint version locally to see the errors. It would be really convenient to change HLint version manually and explicitly, when you want. This will also help with better reproducibility 🙂

ndmitchell commented 4 years ago

The recommended command line to use is:

curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s .

Which just forwards to the one you list. I imagine taking an @version-number or similar would work? Patches very welcome!

chshersh commented 4 years ago

@ndmitchell Thanks, that's much shorter! I see that the hlint repository has tags and official releases. Does it mean that something like this already can work?

curl -sSL https://raw.github.com/ndmitchell/hlint/v2.2.11/misc/run.sh | sh -s .
ndmitchell commented 4 years ago

No, that script always grabs the latest, but might no longer work as things change. If it could be made to work with low effort that would be great, but my guess is the information is just not there.

KristianBalaj commented 1 year ago

Feel free to check out the PR 🙌

chshersh commented 1 year ago

@KristianBalaj Thanks for getting back to this really old issue!

I'm actually fine with closing it, as I no longer use neil to install HLint. Moreover, I'm no longer using Travis CI.

Instead, I download the HLint binary directly from GitHub release in my GitHub Actions like this:

    - name: Run HLint
      env:
         HLINT_VERSION: "3.5"
      run: |
        curl -L https://github.com/ndmitchell/hlint/releases/download/v${HLINT_VERSION}/hlint-${HLINT_VERSION}-x86_64-linux.tar.gz --output hlint.tar.gz
        tar -xvf hlint.tar.gz
        ./hlint-${HLINT_VERSION}/hlint src/ test/

So I'm happy to close this issue 👌🏻