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

Fixes to the bots.sh pre-commit action #317

Merged
merged 3 commits into from
Aug 19, 2022

Conversation

conradtchan
Copy link
Collaborator

Type of PR:
Bug fix

Description:

  • Creation of the AUTHORS file is not threadsafe, so parallel pre-commit cannot be used. Set require_serial: true
  • Update .pre-commit-config.yaml formatting
  • Only the first file being passed through using the --file option was being processed. Now takes a list of files
  • Only run with the subset of files that would be run if the full bots.sh script was being run
  • Optimisation to remove unnecessary calls to get_only_files_in_git(), because files are already in git (or will be in git) if they are being handled by pre-commit.

Testing:
Source files were manually changed to violate the bots rules, and confirmed that this blocked the commit. Run time is only a few seconds, which shows that the script is only being run on the relevant files.

Did you run the bots? yes

@conradtchan conradtchan merged commit 8bf3af0 into danieljprice:master Aug 19, 2022
@conradtchan conradtchan deleted the pre-commit-bots branch August 19, 2022 04:14
s-neilson pushed a commit to s-neilson/phantom that referenced this pull request Mar 18, 2023
* allow multiple files to be passed to bots script

require bots script to run in serial because AUTHORS creation is not threadsafe

* fix: don't filter out author file

* optimisation: no need to check if file is in git if using pre-commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant