test: allow arguments to be forwarded to flake8 in lint-python.sh #13649

pull jamesob wants to merge 1 commits into bitcoin:master from jamesob:2018-07-python-lint-args changing 1 files +1 −1
  1. jamesob commented at 6:15 PM on July 12, 2018: member

    In order to use lint-python.sh from within various in-editor linting frameworks (e.g. ALE, flycheck), we need to allow its arguments to be forwarded to the wrapped flake8 invocation.

    For what it's worth, here's my bitcoin-specific ALE vim config for doing so (requires this changeset):

    $ grep python /home/james/src/bitcoin/.exrc
    
    let g:ale_python_flake8_executable="/home/james/src/bitcoin/test/lint/lint-python.sh"
    
  2. jamesob force-pushed on Jul 12, 2018
  3. jamesob force-pushed on Jul 12, 2018
  4. fanquake added the label Scripts and tools on Jul 12, 2018
  5. in test/lint/lint-python.sh:83 in 96c1a4c259 outdated
      79 | @@ -77,4 +80,4 @@ export LC_ALL=C
      80 |  # W605 invalid escape sequence "x"
      81 |  # W606 'async' and 'await' are reserved keywords starting with Python 3.7
      82 |  
      83 | -flake8 --ignore=B,C,E,F,I,N,W --select=E101,E112,E113,E115,E116,E125,E129,E131,E133,E223,E224,E242,E266,E271,E272,E273,E274,E275,E304,E306,E401,E402,E502,E701,E702,E703,E714,E721,E741,E742,E743,F401,E901,E902,F402,F404,F406,F407,F601,F602,F621,F622,F631,F701,F702,F703,F704,F705,F706,F707,F811,F812,F821,F822,F823,F831,F841,W191,W291,W292,W293,W504,W601,W602,W603,W604,W605,W606 .
      84 | +flake8 --ignore=B,C,E,F,I,N,W --select=E101,E112,E113,E115,E116,E125,E129,E131,E133,E223,E224,E242,E266,E271,E272,E273,E274,E275,E304,E306,E401,E402,E502,E701,E702,E703,E714,E721,E741,E742,E743,F401,E901,E902,F402,F404,F406,F407,F601,F602,F621,F622,F631,F701,F702,F703,F704,F705,F706,F707,F811,F812,F821,F822,F823,F831,F841,W191,W291,W292,W293,W504,W601,W602,W603,W604,W605,W606 "$ARGS"
    


    promag commented at 3:16 PM on July 13, 2018:

    Can you try ...W606 "${@:-.}"?

  6. DrahtBot commented at 11:25 AM on July 16, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->No more conflicts as of last run.

  7. DrahtBot added the label Needs rebase on Aug 13, 2018
  8. laanwj commented at 2:00 PM on August 31, 2018: member

    This should be easy to merge, however needs rebase and comment addressed.

    ping @jamesob

  9. ken2812221 commented at 2:21 PM on August 31, 2018: contributor

    I would suggest to do this:

    diff --git a/test/lint/lint-python.sh b/test/lint/lint-python.sh
    index 5afb70f2e..9ebd171eb 100755
    --- a/test/lint/lint-python.sh
    +++ b/test/lint/lint-python.sh
    @@ -8,7 +8,7 @@
    
     export LC_ALL=C
    
    -ARGS="$*"
    +ARGS="$@"
     [ -z "$ARGS" ] && ARGS="."
    
     # E101 indentation contains mixed spaces and tabs
    @@ -80,4 +80,4 @@ ARGS="$*"
     # W605 invalid escape sequence "x"
     # W606 'async' and 'await' are reserved keywords starting with Python 3.7
    
    -flake8 --ignore=B,C,E,F,I,N,W --select=E101,E112,E113,E115,E116,E125,E129,E131,E133,E223,E224,E242,E266,E271,E272,E273,E274,E275,E304,E306,E401,E402,E502,E701,E702,E703,E714,E721,E741,E742,E743,F401,E901,E902,F402,F404,F406,F407,F601,F602,F621,F622,F631,F701,F702,F703,F704,F705,F706,F707,F811,F812,F821,F822,F823,F831,F841,W191,W291,W292,W293,W504,W601,W602,W603,W604,W605,W606 "$ARGS"
    +flake8 --ignore=B,C,E,F,I,N,W --select=E101,E112,E113,E115,E116,E125,E129,E131,E133,E223,E224,E242,E266,E271,E272,E273,E274,E275,E304,E306,E401,E402,E502,E701,E702,E703,E714,E721,E741,E742,E743,F401,E901,E902,F402,F404,F406,F407,F601,F602,F621,F622,F631,F701,F702,F703,F704,F705,F706,F707,F811,F812,F821,F822,F823,F831,F841,W191,W291,W292,W293,W504,W601,W602,W603,W604,W605,W606 $ARGS
    

    Then we can use multiple files: ./test/lint/lint-python.sh $(git ls-files -- '*.py')

  10. jamesob force-pushed on Sep 24, 2018
  11. jamesob commented at 9:41 PM on September 24, 2018: member

    Rebased and took some combination of @promag and @ken2812221's recommended changes. I'd have abandoned this change if it didn't make writing tests slightly more pleasant :).

  12. DrahtBot removed the label Needs rebase on Sep 24, 2018
  13. test: allow arguments to be forwarded to flake8 in lint-python.sh 854c85ae90
  14. jamesob force-pushed on Sep 24, 2018
  15. MarcoFalke merged this on Oct 8, 2018
  16. MarcoFalke closed this on Oct 8, 2018

  17. MarcoFalke referenced this in commit a89896fadb on Oct 8, 2018
  18. MarcoFalke locked this on Sep 8, 2021

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: 2026-04-27 21:15 UTC

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