Enable W191 indentation contains tabs and W291 trailing whitespace flake8 checks for Python files #13210

pull jbampton wants to merge 1 commits into bitcoin:master from jbampton:remove-whitespace changing 13 files +413 −411
  1. jbampton commented at 3:31 PM on May 10, 2018: contributor

    No description provided.

  2. laanwj added the label Refactoring on May 10, 2018
  3. in contrib/linearize/linearize-data.py:173 in d357e36382 outdated
     169 | @@ -170,7 +170,7 @@ def writeBlock(self, inhdr, blk_hdr, rawblock):
     170 |  			self.highTS = blkTS
     171 |  
     172 |  		if (self.blkCountOut % 1000) == 0:
     173 | -			print('%i blocks scanned, %i blocks written (of %i, %.1f%% complete)' % 
     174 | +			print('%i blocks scanned, %i blocks written (of %i, %.1f%% complete)' %
    


    laanwj commented at 3:55 PM on May 10, 2018:

    Looks like the travis linter fails here, because tabs are used instead of spaces for indenting. Which was already the case. To match the style of the other files, I think you'd need to change tabs to four spaces throughout the file.

  4. practicalswift commented at 4:13 PM on May 10, 2018: contributor

    Concept ACK :+1:

    For reviewers – use ?w=1 to review ignoring whitespace changes.

    To make this improvement persistent, please enable the W291 check in lint-python.sh. That will make Travis catch any regressions.

    Suggested patch:

    diff --git a/contrib/devtools/lint-python.sh b/contrib/devtools/lint-python.sh
    index 2393370..affbdea 100755
    --- a/contrib/devtools/lint-python.sh
    +++ b/contrib/devtools/lint-python.sh
    @@ -61,6 +61,7 @@
     # F823 local variable name … referenced before assignment
     # F831 duplicate argument name in function definition
     # F841 local variable 'foo' is assigned to but never used
    +# W291 trailing whitespace
     # W292 no newline at end of file
     # W293 blank line contains whitespace
     # W504 line break after binary operator
    @@ -71,4 +72,4 @@
     # 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=E112,E113,E115,E116,E125,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,W292,W293,W504,W601,W602,W603,W604,W605,W606 .
    +flake8 --ignore=B,C,E,F,I,N,W --select=E112,E113,E115,E116,E125,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,W291,W292,W293,W504,W601,W602,W603,W604,W605,W606 .
    

    Nice first-time contribution!

  5. MarcoFalke commented at 4:57 PM on May 10, 2018: member
  6. promag commented at 5:22 PM on May 10, 2018: member

    👍 @practicalswift suggestion as a 2nd commit.

  7. promag commented at 5:24 PM on May 10, 2018: member

    These commits could be script diffs?

  8. jbampton force-pushed on May 10, 2018
  9. promag commented at 5:26 PM on May 10, 2018: member

    @MarcoFalke why squash? These are independent unrelated. PR title could be improved.

  10. promag commented at 5:29 PM on May 10, 2018: member

    Sorry for the spam 👼 add Indentation contains tabs (W191) to lint?

  11. jbampton renamed this:
    Trivial: Remove trailing whitespace from Python files
    Enable W291 trailing whitespace flake8 check for Python files
    on May 10, 2018
  12. jbampton commented at 6:09 PM on May 10, 2018: contributor

    Squashed and PR title has been updated now. 👍

  13. jbampton force-pushed on May 10, 2018
  14. Enable W191 and W291 flake8 checks.
    Remove trailing whitespace from Python files.
    Convert tabs to spaces.
    0d31ef4762
  15. jbampton force-pushed on May 10, 2018
  16. jbampton renamed this:
    Enable W291 trailing whitespace flake8 check for Python files
    Enable W191 indentation contains tabs and W291 trailing whitespace flake8 checks for Python files
    on May 10, 2018
  17. jbampton commented at 10:22 PM on May 10, 2018: contributor

    Hey @promag both W191 and W291 flake8 checks are now added 👍

  18. promag commented at 10:52 PM on May 10, 2018: member

    Tested ACK 0d31ef4.

  19. MarcoFalke commented at 12:58 AM on May 11, 2018: member

    utACK 0d31ef4762f5a1428a57439d26551a99f15ddc2e

  20. MarcoFalke merged this on May 11, 2018
  21. MarcoFalke closed this on May 11, 2018

  22. MarcoFalke referenced this in commit 81d0d565ab on May 11, 2018
  23. jbampton deleted the branch on May 11, 2018
  24. UdjinM6 referenced this in commit f7ebbe67f5 on Jul 29, 2020
  25. UdjinM6 referenced this in commit 1aeee2faea on Jul 29, 2020
  26. PastaPastaPasta referenced this in commit 18eebe5251 on Jul 29, 2020
  27. 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-22 06:15 UTC

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