Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts and tools: Fix devtools/copyright_header.py to always honor exclusions #15258

Merged
merged 2 commits into from Jan 26, 2019

Conversation

Projects
None yet
4 participants
@Empact
Copy link
Member

commented Jan 25, 2019

This script compared paths relative to the report directory to test for exclusion,
meaning the EXCLUDE_DIRS directory exclusions did not work properly, as
they were relative to the project root.

Fix this by creating absolute paths through the combination of:
'git ls-files --full-name' and 'git rev-parse --show-toplevel'

Once this is done, we can stop testing for the names that would otherwise
appear when exclusion of leveldb, secp256k1, etc., did not work as intended.

Empact added some commits Jan 25, 2019

Scripts and tools: Fix devtools/copyright_header.py to always honor e…
…xclusions

This script compared paths relative to the report directory to test for exclusion,
meaning the directory exclusions did not work properly, as they were relative to
the project root.

Fix this by creating absolute paths through the combination of:
'git ls-files --full-name' and 'git rev-parse --show-toplevel'
Scripts and tools: Drop no-longer-relevant copyright holder names
Now that leveldb, secp256k1, etc. are reliably excluded, these
names will not show up in the searched files.
@Empact

This comment has been minimized.

Copy link
Member Author

commented Jan 25, 2019

Before:

$ contrib/devtools/copyright_header.py report src
-------------------------------------------------------------------------------
720 files examined according to INCLUDE and EXCLUDE fnmatch rules
-------------------------------------------------------------------------------

  26 with zero copyrights
 549 with one copyright
 143 with two copyrights
   2 with three copyrights
   0 with four or more copyrights

-------------------------------------------------------------------------------
Copyrights with dominant style:
e.g. "Copyright (c)" and "<year>" or "<startYear>-<endYear>":

 135 with 'Satoshi Nakamoto\n'
 492 with 'The Bitcoin Core developers\n'
 127 with 'The LevelDB Authors\. All rights reserved\.\n'
   1 with 'BitPay Inc\.\n'
   5 with 'Pieter Wuille\n'
  22 with 'Pieter Wuille +\*\n'
   2 with 'Pieter Wuille, Andrew Poelstra +\*\n'
   6 with 'Andrew Poelstra +\*\n'
   1 with 'Diederik Huys, Pieter Wuille +\*\n'
   1 with 'Intel Corporation'
   6 with 'The Zcash developers'
   1 with 'Jeremy Rubin'

-------------------------------------------------------------------------------
Copyrights with year list style:
e.g. "Copyright (c)" and "<year1>, <year2>, ...":

  25 with 'Pieter Wuille +\*\n'
   2 with 'Pieter Wuille, Gregory Maxwell +\*\n'
   1 with 'Thomas Daede, Cory Fields +\*\n'

-------------------------------------------------------------------------------
Copyrights with no "(c)" style:
e.g. "Copyright" and "<year>" or "<startYear>-<endYear>":

   3 with 'Bitcoin Core Developers\n'
   3 with 'The LevelDB Authors\. All rights reserved\.\n'
   7 with 'BitPay Inc\.\n'
   1 with 'Wladimir J. van der Laan\n'

-------------------------------------------------------------------------------
0 with unexpected copyright holder names
-------------------------------------------------------------------------------

After:

$ contrib/devtools/copyright_header.py report src
-------------------------------------------------------------------------------
507 files examined according to INCLUDE and EXCLUDE fnmatch rules
-------------------------------------------------------------------------------

  11 with zero copyrights
 355 with one copyright
 139 with two copyrights
   2 with three copyrights
   0 with four or more copyrights

-------------------------------------------------------------------------------
Copyrights with dominant style:
e.g. "Copyright (c)" and "<year>" or "<startYear>-<endYear>":

 135 with 'Satoshi Nakamoto\n'
 491 with 'The Bitcoin Core developers\n'
   5 with 'Pieter Wuille\n'
   1 with 'Intel Corporation'
   6 with 'The Zcash developers'
   1 with 'Jeremy Rubin'

-------------------------------------------------------------------------------
Copyrights with year list style:
e.g. "Copyright (c)" and "<year1>, <year2>, ...":


-------------------------------------------------------------------------------
Copyrights with no "(c)" style:
e.g. "Copyright" and "<year>" or "<startYear>-<endYear>":


-------------------------------------------------------------------------------
0 with unexpected copyright holder names
-------------------------------------------------------------------------------

$ contrib/devtools/copyright_header.py report . is unchanged.

@DrahtBot

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15257 (Scripts and tools: Bump flake8 to 3.6.0 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.

MarcoFalke added a commit to MarcoFalke/bitcoin that referenced this pull request Jan 26, 2019

Merge bitcoin#15258: Scripts and tools: Fix devtools/copyright_header…
….py to always honor exclusions

ad5e5a1 Scripts and tools: Drop no-longer-relevant copyright holder names (Ben Woosley)
2434ab5 Scripts and tools: Fix devtools/copyright_header.py to always honor exclusions (Ben Woosley)

Pull request description:

  This script compared paths relative to the report directory to test for exclusion,
  meaning the `EXCLUDE_DIRS` directory exclusions did not work properly, as
  they were relative to the project root.

  Fix this by creating absolute paths through the combination of:
  'git ls-files --full-name' and 'git rev-parse --show-toplevel'

  Once this is done, we can stop testing for the names that would otherwise
  appear when exclusion of leveldb, secp256k1, etc., did not work as intended.

Tree-SHA512: 0fa9b0a627e8ddb2d899eedee927ea8a809cb2ceee87c0920c151e5ca2103f7d8c463e3b379d5e2eb925fc3d7d8003082ffd9cbc03907ca0c448e8238e3a2684

@MarcoFalke MarcoFalke merged commit ad5e5a1 into bitcoin:master Jan 26, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.