Skip to content

Conversation

Sjors
Copy link
Member

@Sjors Sjors commented Jan 5, 2018

MacOS does not support grep -P out of the box. This change makes
it easier for developers to check for whitespace problems locally.

Based on this and this Stack Exchange answer.

Tested with:

export TRAVIS_COMMIT_RANGE='fe78c9a...62e0453'
contrib/devtools/lint-whitespace.sh 
This diff appears to have added new lines with tab characters instead of spaces.
The following changes were suspected:

diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
@@ -0,0 +1,110 @@
+	num.setint64(n);

MacOS does not support 'grep -P' out of the box. This change makes
it easier for developers to check for whitespace problems locally.
Copy link
Contributor

@jonasschnelli jonasschnelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested (macOS) ACK 40b17f5

@sipa
Copy link
Member

sipa commented Jan 6, 2018

Concept ACK

@randolf
Copy link
Contributor

randolf commented Jan 9, 2018

On NetBSD 7.0, "grep -P" is also not supported, so this change can be helpful there too (and maybe other platforms as well?).

@practicalswift
Copy link
Contributor

Concept ACK

@laanwj
Copy link
Member

laanwj commented Feb 17, 2018

Please, next time someone writes a script like this, use Python. Shell script is terrible for making portable tools. Every time someone introduces a shell script we go through countless iterations to make it compatible with every shell and OS tool environment since the 80's.

(nevertheless, concept ACK)

@laanwj laanwj merged commit 40b17f5 into bitcoin:master Mar 6, 2018
laanwj added a commit that referenced this pull request Mar 6, 2018
40b17f5 [scripts] lint-whitespace: use perl instead of grep -P (Sjors Provoost)

Pull request description:

  MacOS does not support `grep -P` out of the box. This change makes
  it easier for developers to check for whitespace problems locally.

  Based on [this](https://stackoverflow.com/a/16658690) and [this](https://serverfault.com/a/504387) Stack Exchange answer.

  Tested with:
  ```sh
  export TRAVIS_COMMIT_RANGE='fe78c9a...62e0453'
  contrib/devtools/lint-whitespace.sh
  This diff appears to have added new lines with tab characters instead of spaces.
  The following changes were suspected:

  diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
  @@ -0,0 +1,110 @@
  +	num.setint64(n);
  ```

Tree-SHA512: 37c342a0ca2580289cf326a278a051a7c21ba918d6b2143fd9987f159fab85f1de3d770fcf532a642cd5d1957afc8595678128196e102dc473924758f133db7f
@Sjors Sjors deleted the lint-whitespace-no-grep-P branch March 6, 2018 22:17
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 13, 2020
…rep -P

40b17f5 [scripts] lint-whitespace: use perl instead of grep -P (Sjors Provoost)

Pull request description:

  MacOS does not support `grep -P` out of the box. This change makes
  it easier for developers to check for whitespace problems locally.

  Based on [this](https://stackoverflow.com/a/16658690) and [this](https://serverfault.com/a/504387) Stack Exchange answer.

  Tested with:
  ```sh
  export TRAVIS_COMMIT_RANGE='fe78c9a...62e0453'
  contrib/devtools/lint-whitespace.sh
  This diff appears to have added new lines with tab characters instead of spaces.
  The following changes were suspected:

  diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
  @@ -0,0 +1,110 @@
  +	num.setint64(n);
  ```

Tree-SHA512: 37c342a0ca2580289cf326a278a051a7c21ba918d6b2143fd9987f159fab85f1de3d770fcf532a642cd5d1957afc8595678128196e102dc473924758f133db7f
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 13, 2020
…rep -P

40b17f5 [scripts] lint-whitespace: use perl instead of grep -P (Sjors Provoost)

Pull request description:

  MacOS does not support `grep -P` out of the box. This change makes
  it easier for developers to check for whitespace problems locally.

  Based on [this](https://stackoverflow.com/a/16658690) and [this](https://serverfault.com/a/504387) Stack Exchange answer.

  Tested with:
  ```sh
  export TRAVIS_COMMIT_RANGE='fe78c9a...62e0453'
  contrib/devtools/lint-whitespace.sh
  This diff appears to have added new lines with tab characters instead of spaces.
  The following changes were suspected:

  diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
  @@ -0,0 +1,110 @@
  +	num.setint64(n);
  ```

Tree-SHA512: 37c342a0ca2580289cf326a278a051a7c21ba918d6b2143fd9987f159fab85f1de3d770fcf532a642cd5d1957afc8595678128196e102dc473924758f133db7f
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 17, 2020
…rep -P

40b17f5 [scripts] lint-whitespace: use perl instead of grep -P (Sjors Provoost)

Pull request description:

  MacOS does not support `grep -P` out of the box. This change makes
  it easier for developers to check for whitespace problems locally.

  Based on [this](https://stackoverflow.com/a/16658690) and [this](https://serverfault.com/a/504387) Stack Exchange answer.

  Tested with:
  ```sh
  export TRAVIS_COMMIT_RANGE='fe78c9a...62e0453'
  contrib/devtools/lint-whitespace.sh
  This diff appears to have added new lines with tab characters instead of spaces.
  The following changes were suspected:

  diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
  @@ -0,0 +1,110 @@
  +	num.setint64(n);
  ```

Tree-SHA512: 37c342a0ca2580289cf326a278a051a7c21ba918d6b2143fd9987f159fab85f1de3d770fcf532a642cd5d1957afc8595678128196e102dc473924758f133db7f
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 18, 2020
…rep -P

40b17f5 [scripts] lint-whitespace: use perl instead of grep -P (Sjors Provoost)

Pull request description:

  MacOS does not support `grep -P` out of the box. This change makes
  it easier for developers to check for whitespace problems locally.

  Based on [this](https://stackoverflow.com/a/16658690) and [this](https://serverfault.com/a/504387) Stack Exchange answer.

  Tested with:
  ```sh
  export TRAVIS_COMMIT_RANGE='fe78c9a...62e0453'
  contrib/devtools/lint-whitespace.sh
  This diff appears to have added new lines with tab characters instead of spaces.
  The following changes were suspected:

  diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
  @@ -0,0 +1,110 @@
  +	num.setint64(n);
  ```

Tree-SHA512: 37c342a0ca2580289cf326a278a051a7c21ba918d6b2143fd9987f159fab85f1de3d770fcf532a642cd5d1957afc8595678128196e102dc473924758f133db7f
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants