Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Implement patch checking during pre-commit hook #127

Merged
merged 24 commits into from
Jan 22, 2016

Conversation

westonruter
Copy link
Contributor

  • Patch checking is aware of the Git index, so only staged changes will be checked.
  • Consolidates pre-commit and Travis CI logic into common library.
  • Moves Travis before_script logic into install script.

Fixes #126
Fixes #100
Fixes #77
Fixes #40
Fixes #49
Fixes #30
Fixes #28

* Patch checking is aware of the Git index, so only staged changes will be checked.
* Consolidates pre-commit and Travis CI logic into common library.
* Moves Travis before_script logic into install script.
@valendesigns
Copy link
Contributor

Looks good! We'll need to test this PR out with some repos to verify backwards compatibility.

@westonruter
Copy link
Contributor Author

Thanks.

Back compat isn't so important as it working. The .travis.yml will have to be updated to refer to the install script. Projects using dev-lib won't break if this gets merged because the submodule will be pegging it as a compatible state.

I have tested this in the pre-commit hook but I need to run through the tests for Travis still.

This should be a huge improvement to ensuring quality across repos, as PHPCS is downloaded if not already installed and it checks patches instead of the full codebases. This has been a long time in coming!

@westonruter
Copy link
Contributor Author

I'm also wary of Windows compatibility, but I'm not going to worry too much about that :-)

@westonruter westonruter force-pushed the feature/pre-commit-improvements branch 4 times, most recently from a757b09 to 08e2416 Compare January 16, 2016 08:36
@westonruter westonruter force-pushed the feature/pre-commit-improvements branch from 08e2416 to 11faa88 Compare January 16, 2016 08:41
@westonruter westonruter force-pushed the feature/pre-commit-improvements branch from 11faa88 to 36f2d4d Compare January 16, 2016 08:45
@westonruter
Copy link
Contributor Author

I went through and tested the scenarios in Travis: xwp/wp-customize-widgets-plus#41

And then I made the necessary fixes here.

The required changes to support the new dev-lib can be seen here: xwp/wp-customize-widgets-plus#42

@valendesigns See anything else I missed? If not, please merge.

echo "LIMIT_TRAVIS_PR_CHECK_SCOPE is obsolete; use CHECK_SCOPE env var instead" 1>&2
return 1
fi
CHECK_SCOPE=${CHECK_SCOPE:-changed-files} # 'all', 'changed-files', 'patches'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe patches should be the default?

@westonruter westonruter force-pushed the feature/pre-commit-improvements branch 2 times, most recently from 6062701 to bc1429b Compare January 17, 2016 05:18
@westonruter westonruter force-pushed the feature/pre-commit-improvements branch from bc1429b to 614a334 Compare January 17, 2016 05:29
@westonruter westonruter force-pushed the feature/pre-commit-improvements branch from ae985c4 to 38ec543 Compare January 18, 2016 00:15
@valendesigns
Copy link
Contributor

I made the change you wanted to default to patches instead of changed-files and then updated the Authoring plugin. It appeared to go well so I'll merge tomorrow. I do want to test it on https://github.com/xwp/wp-customize-snapshots or https://github.com/xwp/wp-customize-concurrency to be sure nothing else is needed before merging though. 😄

valendesigns added a commit that referenced this pull request Jan 22, 2016
Implement patch checking during pre-commit hook
@valendesigns valendesigns merged commit 5cc3b0d into master Jan 22, 2016
@kasparsd kasparsd deleted the feature/pre-commit-improvements branch January 17, 2019 08:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants