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

Add --all-files option to pre-commit command to avoid skipping the test #273

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

nhuet
Copy link
Contributor

@nhuet nhuet commented Oct 9, 2023

No tests were actually done by the linter action because pre-commit run look only files in the index by default.
When checkouting a whole PR, no files are in the index so no files are checked.

Previously, the job returned something like

Trim Trailing Whitespace.............................(no files to check)Skipped
Fix End of Files.....................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
Check for added large files..........................(no files to check)Skipped
Pretty format JSON...................................(no files to check)Skipped
isort (python).......................................(no files to check)Skipped
black................................................(no files to check)Skipped
nbqa-isort...........................................(no files to check)Skipped
nbqa-black...........................................(no files to check)Skipped
nbqa-pycln...........................................(no files to check)Skipped
nbstripout...........................................(no files to check)Skipped

Now the checks are done (and should read as "Passed")
We make a pre-commit run --all-files in this commit to have the job pass.

We also remove the pretty-format-json hook which was tampering with the notebooks (oddly only remotely on the github runner, not locally on my laptop), and was not very useful for the repository anyway.

No tests were actually done by the linter action because `pre-commit
run` look only files in the index by default.
When checkout a whole PR, no files are in the index so no files are
checked.

Previously, the job returned something like

	Trim Trailing Whitespace.............................(no files to check)Skipped
	Fix End of Files.....................................(no files to check)Skipped
	Check Yaml...........................................(no files to check)Skipped
    	Check for added large files..........................(no files to check)Skipped
    	Pretty format JSON...................................(no files to check)Skipped
    	isort (python).......................................(no files to check)Skipped
    	black................................................(no files to check)Skipped
    	nbqa-isort...........................................(no files to check)Skipped
    	nbqa-black...........................................(no files to check)Skipped
    	nbqa-pycln...........................................(no files to check)Skipped
    	nbstripout...........................................(no files to check)Skipped

Now the checks are done (and should read as "Passed")
We make a `pre-commit run --all-files` in this commit to have the job
pass.

We also remove the pretty-format-json hook which was tampering with the
notebooks (oddly only remotely on the github runner, not locally on my
laptop), and was not very useful for the repository anyway.
Copy link
Collaborator

@g-poveda g-poveda left a comment

Choose a reason for hiding this comment

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

lgtm

@g-poveda g-poveda merged commit 1ba371e into airbus:master Nov 17, 2023
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.

2 participants