[scripts] lint-whitespace: add param to check last N commits #12098

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:lint-whitespace-n-commits changing 1 files +19 −5
  1. Sjors commented at 2:07 PM on January 5, 2018: member

    E.g. before you push three commits to Github and upset Travis, check if you didn't make any whitespace mistakes:

    contrib/devtools/lint-whitespace.sh 3
    

    This is slightly more convenient than doing:

    TRAVIS_COMMIT_RANGE=HEAD~3...HEAD contrib/devtools/lint-whitespace.sh
    
  2. jonasschnelli commented at 7:36 PM on January 5, 2018: contributor

    Tested ACK db161bda123f58e26b9d8a9cab67bf8847d066e3.

    Would be great if the script – given no parameter and no TRAVIS_COMMIT_RANGE env var – would check for whitespaces in the changed but not committed files (ldentical to TRAVIS_COMMIT_RANGE='HEAD')

  3. Sjors commented at 8:32 PM on January 5, 2018: member

    @jonasschnelli I wanted that as well, but didn't know how. I'll try your suggestion.

  4. in contrib/devtools/lint-whitespace.sh:19 in db161bda12 outdated
      19 | +    echo "Cannot run lint-whitespace.sh without commit range. To run locally, use:"
      20 | +    echo "TRAVIS_COMMIT_RANGE='<commit range>' .lint-whitespace.sh"
      21 | +    echo "For example:"
      22 | +    echo "TRAVIS_COMMIT_RANGE='47ba2c3...ee50c9e' .lint-whitespace.sh"
      23 | +    echo "Alternatively, specify the number of commits to check:"
      24 | +    echo ".lint-whitespace 2"
    


    sipa commented at 9:56 PM on January 5, 2018:

    .sh

  5. fanquake added the label Scripts and tools on Jan 5, 2018
  6. [scripts] lint-whitespace: check last N commits or unstaged changes
    Get usage instructions:
    .lint-whitespace.sh -?
    8dbf740f80
  7. Sjors force-pushed on Jan 8, 2018
  8. Sjors commented at 11:12 AM on January 8, 2018: member

    @jonasschnelli it now checks unstaged changes if TRAVIS_COMMIT_RANGE is absent and you don't provide an argument.

    Because the script no longer throws an error if you launch it without arguments, you can now get usage instructions with .lint-whitespace.sh -?

  9. practicalswift commented at 4:29 PM on February 8, 2018: contributor

    Concept ACK. Nice stuff!

  10. laanwj commented at 10:17 PM on March 6, 2018: member

    tACK 8dbf740f8, this makes the script much easier to use manually

  11. laanwj merged this on Mar 6, 2018
  12. laanwj closed this on Mar 6, 2018

  13. laanwj referenced this in commit 17c44b208f on Mar 6, 2018
  14. Sjors deleted the branch on Mar 6, 2018
  15. PastaPastaPasta referenced this in commit ad554014e9 on Jun 13, 2020
  16. PastaPastaPasta referenced this in commit 7695336d78 on Jun 13, 2020
  17. PastaPastaPasta referenced this in commit 433d728a1c on Jun 17, 2020
  18. PastaPastaPasta referenced this in commit e9b42fd5c3 on Jun 18, 2020
  19. zkbot referenced this in commit 43ac2062f9 on Oct 28, 2020
  20. zkbot referenced this in commit 84a5830aaa on Nov 9, 2020
  21. 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-14 09:15 UTC

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