lint: Make all linters work under the default macOS dev environment (build-osx.md) #14115

pull practicalswift wants to merge 4 commits into bitcoin:master from practicalswift:linter-macos changing 5 files +26 −6
  1. practicalswift commented at 11:04 pm on August 30, 2018: contributor

    The linters are thoroughly tested under Ubuntu which is what we use in Travis. When reading #14041 I understood that some developers were experiencing problems when running the linters on their local machines.

    Assuming these local machines were running macOS I installed a fresh macOS VM, followed the instructions in build-osx.md and ran the linters.

    This PR contains the changes needed to make lint-all.sh run as expected.

    Ideally the linters would continuously run also under a Travis macOS environment to make sure we catch these kind of issues before merge.

  2. macOS fix: Avoid mapfile due to ancient version of bash shipped with macOS b57d7d92fe
  3. macOS fix: Work around empty (sub)expression error when using BSD grep ec4d57bbb3
  4. macOS fix: Add excludes for checks added in the newer shellcheck version installed by brew 908a559f33
  5. macOS fix: Check for correct version of flake8 to avoid spurious warnings. The brew installed flake8 version is Python 2 based and does not work. 341f7c7b0e
  6. fanquake added the label Scripts and tools on Aug 30, 2018
  7. DrahtBot commented at 2:21 am on August 31, 2018: member
    • #13728 (Scripts and tools: Run the CI lint stage on mac and linux both 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.

  8. laanwj commented at 11:28 am on August 31, 2018: member
    Concept ACK
  9. MarcoFalke commented at 11:49 am on August 31, 2018: member
    utACK 341f7c7b0e77edcc02cb3429fb9a3d49745332cc
  10. Empact commented at 8:12 pm on September 1, 2018: member
    See also: #13728 which is similar but fixes the linter errors rather than disabling them, and runs the linters on macos via CI.
  11. fanquake commented at 5:38 am on September 2, 2018: member

    Tested on macOS 10.13.6, master https://github.com/bitcoin/bitcoin/commit/2070a545e2c4e8c2dff4c0fb40b8fd2f68fc2cad has a bunch of warnings/failures:

    0./test/lint/lint-all.sh
    1test/lint/lint-format-strings.sh: line 36: mapfile: command not found
    2grep: empty (sub)expression
    3/usr/local/lib/python3.7/site-packages/pycodestyle.py:113: FutureWarning: Possible nested set at position 1
    4  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
    5grep: empty (sub)expression
    6Missing "export LC_ALL=C" (to avoid locale dependence) as first non-comment non-empty line in .travis/lint_04_install.sh
    7grep: empty (sub)expression
    8^---- failure generated from test/lint/lint-shell-locale.sh
    

    Using https://github.com/bitcoin/bitcoin/pull/14115/commits/341f7c7b0e77edcc02cb3429fb9a3d49745332cc and after brew install spellcheck and pip3 install flake8, all linters seem to run, with no warnings.

    Did not check if this breaks anything on a different OS etc. tACK https://github.com/bitcoin/bitcoin/pull/14115/commits/341f7c7b0e77edcc02cb3429fb9a3d49745332cc

  12. practicalswift commented at 7:44 am on September 5, 2018: contributor
    Please review :-)
  13. MarcoFalke merged this on Sep 5, 2018
  14. MarcoFalke closed this on Sep 5, 2018

  15. MarcoFalke referenced this in commit 97ccd2b84e on Sep 5, 2018
  16. UdjinM6 referenced this in commit 889990fbef on Jul 29, 2020
  17. UdjinM6 referenced this in commit 8e05f8b288 on Jul 29, 2020
  18. PastaPastaPasta referenced this in commit 481254c86d on Jul 29, 2020
  19. zkbot referenced this in commit 43ac2062f9 on Oct 28, 2020
  20. zkbot referenced this in commit 84a5830aaa on Nov 9, 2020
  21. practicalswift deleted the branch on Apr 10, 2021
  22. gades referenced this in commit c558370b0e on Apr 20, 2022
  23. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 07:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me