Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa: Pin shellcheck version #15166

Merged

Conversation

practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Jan 14, 2019

Pin shellcheck version.

@promag
Copy link
Contributor

promag commented Jan 14, 2019

Can't we lock the installed version instead?

@practicalswift practicalswift force-pushed the opt-out-of-new-shellcheck-warnings branch from dea6fd4 to f747f4a Compare January 14, 2019 16:33
@practicalswift
Copy link
Contributor Author

@promag The shellcheck on Travis is pre-installed AFAIK - we don't install it explicitly in our Travis conf. Also since we don't control the version the user has installed pinning wouldn't have prevented the version problem described in 908a559.

@promag
Copy link
Contributor

promag commented Jan 14, 2019

@practicalswift IMO what the user has it not a problem, instead it helps if the user has a newer version so he can update the travis one if necessary.

We could run in a docker container?

@practicalswift
Copy link
Contributor Author

practicalswift commented Jan 14, 2019

@promag Yes, pinning the version by going the Docker route would be an alternative way to solve this. I'll let @laanwj chime in here.

@laanwj
Copy link
Member

laanwj commented Jan 14, 2019

I think it makes sense to allow for some variability in shellcheck versions for people that want to run this locally.
(this isn't an argument against pinning as well, though)

@promag
Copy link
Contributor

promag commented Jan 14, 2019

Just to be clear, in travis run the linter in a container with a specific version of shellcheck, locally use the one available in the path?

@maflcko
Copy link
Member

maflcko commented Jan 14, 2019

So we'd still had to support multiple versions of shellcheck

@promag
Copy link
Contributor

promag commented Jan 14, 2019

@MarcoFalke why? The official supported would be the travis IMO. If the linter fails for the user then he either upgrades/downgrades his version or submit a pull to fix the (most likely) new version.

@fanquake fanquake added the Tests label Jan 14, 2019
@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 15, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #13728 (WIP: Scripts and tools: Run the CI lint stage on mac by Empact)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@practicalswift practicalswift force-pushed the opt-out-of-new-shellcheck-warnings branch from f747f4a to 4a037c4 Compare January 15, 2019 08:30
@practicalswift
Copy link
Contributor Author

practicalswift commented Jan 15, 2019

@promag The proposed solution allows for some variability in shellcheck versions. Could you describe what problems foresee with allowing for such variability? If I know the problems I can perhaps help solve them :-)

@koalaman
Copy link
Contributor

As the shellcheck author I would definitely recommend pinning versions rather than filtering suggestions. This is because the scope of existing suggestions often changes through improvements or bugfixes.

For example, the SC2054 warning that commas won't work as an array separator recently had its detection criteria changed, so now shellcheck master (and therefore the next release) will start triggering on test/lint/lint-format-strings.sh due to its array containing unquoted FatalError,0 fprintf,1 ..

By pinning, you can upgrade at your leisure without surprise build breaks.

@practicalswift
Copy link
Contributor Author

@koalaman Thanks for the input! What is the best way to achieve version pinning of shellcheck in Travis? Travis pre-installs shellcheck.

@koalaman
Copy link
Contributor

@practicalswift Unfortunately I'm not very familiar with Travis myself.

Someone contributed a recipe which just downloads a specific release version (which could obviously be improved by verifying the checksum):

export scversion="stable" # or "v0.4.7", or "latest"
wget "https://storage.googleapis.com/shellcheck/shellcheck-${scversion}.linux.x86_64.tar.xz"
tar --xz -xvf shellcheck-"${scversion}".linux.x86_64.tar.xz
cp shellcheck-"${scversion}"/shellcheck /usr/bin/
shellcheck --version

Specific ShellCheck releases can also be run via Docker, if that helps.

@promag
Copy link
Contributor

promag commented Jan 16, 2019

We already use docker so I guess we could use the one available in bionic?

@practicalswift practicalswift force-pushed the opt-out-of-new-shellcheck-warnings branch 3 times, most recently from cae3e0c to 66cafe2 Compare January 16, 2019 14:19
@practicalswift practicalswift force-pushed the opt-out-of-new-shellcheck-warnings branch 2 times, most recently from 83cbca4 to a517541 Compare January 16, 2019 14:49
@practicalswift practicalswift changed the title qa: Ignore shellcheck warnings introduced in new versions qa: Pin shellcheck version Jan 16, 2019
@practicalswift
Copy link
Contributor Author

practicalswift commented Jan 16, 2019

Now pinning the shellcheck version instead. Please re-review :-)

@maflcko
Copy link
Member

maflcko commented Jan 16, 2019

ACK, we do the same for the pip packages

@promag
Copy link
Contributor

promag commented Jan 16, 2019

I guess checksum verification is not necessary. Still curious why not docker. utACK a517541 though.

@practicalswift
Copy link
Contributor Author

@promag We don't use Docker for any of the linters. The non-Docker setup is simpler.

@maflcko maflcko merged commit a517541 into bitcoin:master Jan 17, 2019
maflcko pushed a commit that referenced this pull request Jan 17, 2019
a517541 Remove no longer needed shellcheck suppressions (practicalswift)
0b7196e Fix warnings introduced in shellcheck v0.6.0 (practicalswift)
07a53dc Remove repeated suppression. Fix indentation. (practicalswift)
638e53b Pin shellcheck version to v0.6.0 (practicalswift)

Pull request description:

  Pin `shellcheck` version.

Tree-SHA512: 996e438e424020fe888de1d77ffd33fa32848332febfffbc21a842784aee339332c79c41687c9c577ba1206eb20674623157d584a072e8ae88ae086ee2277bc8
fanquake added a commit that referenced this pull request Jul 5, 2019
1ac454a Enable ShellCheck rules (Hennadii Stepanov)

Pull request description:

  Enable some simple ShellCheck rules.

  Note for reviewers: `bash` and `shellcheck` on macOS are different from ones on Ubuntu.
  For local tests the latest `shellcheck` version 0.6.0 should be used (see #15166).

ACKs for top commit:
  practicalswift:
    utACK 1ac454a
  dongcarl:
    utACK 1ac454a
  fanquake:
    ACK 1ac454a

Tree-SHA512: 8d0a3a5c09fe1a0c22120178f5e6b80f81f746f8c3356b7701ff301c117acb2edea8fe08f08fb54ed73f94b1617515fb239fa28e7ab4121f74872e6494b6f20e
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 29, 2020
@practicalswift practicalswift deleted the opt-out-of-new-shellcheck-warnings branch April 10, 2021 19:37
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Sep 10, 2021
a517541 Remove no longer needed shellcheck suppressions (practicalswift)
0b7196e Fix warnings introduced in shellcheck v0.6.0 (practicalswift)
07a53dc Remove repeated suppression. Fix indentation. (practicalswift)
638e53b Pin shellcheck version to v0.6.0 (practicalswift)

Pull request description:

  Pin `shellcheck` version.

Tree-SHA512: 996e438e424020fe888de1d77ffd33fa32848332febfffbc21a842784aee339332c79c41687c9c577ba1206eb20674623157d584a072e8ae88ae086ee2277bc8
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Sep 24, 2021
a517541 Remove no longer needed shellcheck suppressions (practicalswift)
0b7196e Fix warnings introduced in shellcheck v0.6.0 (practicalswift)
07a53dc Remove repeated suppression. Fix indentation. (practicalswift)
638e53b Pin shellcheck version to v0.6.0 (practicalswift)

Pull request description:

  Pin `shellcheck` version.

Tree-SHA512: 996e438e424020fe888de1d77ffd33fa32848332febfffbc21a842784aee339332c79c41687c9c577ba1206eb20674623157d584a072e8ae88ae086ee2277bc8
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Oct 4, 2021
a517541 Remove no longer needed shellcheck suppressions (practicalswift)
0b7196e Fix warnings introduced in shellcheck v0.6.0 (practicalswift)
07a53dc Remove repeated suppression. Fix indentation. (practicalswift)
638e53b Pin shellcheck version to v0.6.0 (practicalswift)

Pull request description:

  Pin `shellcheck` version.

Tree-SHA512: 996e438e424020fe888de1d77ffd33fa32848332febfffbc21a842784aee339332c79c41687c9c577ba1206eb20674623157d584a072e8ae88ae086ee2277bc8
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Oct 5, 2021
a517541 Remove no longer needed shellcheck suppressions (practicalswift)
0b7196e Fix warnings introduced in shellcheck v0.6.0 (practicalswift)
07a53dc Remove repeated suppression. Fix indentation. (practicalswift)
638e53b Pin shellcheck version to v0.6.0 (practicalswift)

Pull request description:

  Pin `shellcheck` version.

Tree-SHA512: 996e438e424020fe888de1d77ffd33fa32848332febfffbc21a842784aee339332c79c41687c9c577ba1206eb20674623157d584a072e8ae88ae086ee2277bc8
kwvg pushed a commit to kwvg/dash that referenced this pull request Oct 12, 2021
a517541 Remove no longer needed shellcheck suppressions (practicalswift)
0b7196e Fix warnings introduced in shellcheck v0.6.0 (practicalswift)
07a53dc Remove repeated suppression. Fix indentation. (practicalswift)
638e53b Pin shellcheck version to v0.6.0 (practicalswift)

Pull request description:

  Pin `shellcheck` version.

Tree-SHA512: 996e438e424020fe888de1d77ffd33fa32848332febfffbc21a842784aee339332c79c41687c9c577ba1206eb20674623157d584a072e8ae88ae086ee2277bc8
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Oct 23, 2021
1ac454a Enable ShellCheck rules (Hennadii Stepanov)

Pull request description:

  Enable some simple ShellCheck rules.

  Note for reviewers: `bash` and `shellcheck` on macOS are different from ones on Ubuntu.
  For local tests the latest `shellcheck` version 0.6.0 should be used (see bitcoin#15166).

ACKs for top commit:
  practicalswift:
    utACK 1ac454a
  dongcarl:
    utACK 1ac454a
  fanquake:
    ACK 1ac454a

Tree-SHA512: 8d0a3a5c09fe1a0c22120178f5e6b80f81f746f8c3356b7701ff301c117acb2edea8fe08f08fb54ed73f94b1617515fb239fa28e7ab4121f74872e6494b6f20e
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Oct 23, 2021
1ac454a Enable ShellCheck rules (Hennadii Stepanov)

Pull request description:

  Enable some simple ShellCheck rules.

  Note for reviewers: `bash` and `shellcheck` on macOS are different from ones on Ubuntu.
  For local tests the latest `shellcheck` version 0.6.0 should be used (see bitcoin#15166).

ACKs for top commit:
  practicalswift:
    utACK 1ac454a
  dongcarl:
    utACK 1ac454a
  fanquake:
    ACK 1ac454a

Tree-SHA512: 8d0a3a5c09fe1a0c22120178f5e6b80f81f746f8c3356b7701ff301c117acb2edea8fe08f08fb54ed73f94b1617515fb239fa28e7ab4121f74872e6494b6f20e
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Nov 18, 2021
a517541 Remove no longer needed shellcheck suppressions (practicalswift)
0b7196e Fix warnings introduced in shellcheck v0.6.0 (practicalswift)
07a53dc Remove repeated suppression. Fix indentation. (practicalswift)
638e53b Pin shellcheck version to v0.6.0 (practicalswift)

Pull request description:

  Pin `shellcheck` version.

Tree-SHA512: 996e438e424020fe888de1d77ffd33fa32848332febfffbc21a842784aee339332c79c41687c9c577ba1206eb20674623157d584a072e8ae88ae086ee2277bc8
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Dec 4, 2021
1ac454a Enable ShellCheck rules (Hennadii Stepanov)

Pull request description:

  Enable some simple ShellCheck rules.

  Note for reviewers: `bash` and `shellcheck` on macOS are different from ones on Ubuntu.
  For local tests the latest `shellcheck` version 0.6.0 should be used (see bitcoin#15166).

ACKs for top commit:
  practicalswift:
    utACK 1ac454a
  dongcarl:
    utACK 1ac454a
  fanquake:
    ACK 1ac454a

Tree-SHA512: 8d0a3a5c09fe1a0c22120178f5e6b80f81f746f8c3356b7701ff301c117acb2edea8fe08f08fb54ed73f94b1617515fb239fa28e7ab4121f74872e6494b6f20e
gades pushed a commit to cosanta/cosanta-core that referenced this pull request May 24, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants