Skip to content

Added nb-clean to pre-commit config#3618

Open
Prathamesh8989 wants to merge 2 commits intopytorch:masterfrom
Prathamesh8989:clean-precommit-fix
Open

Added nb-clean to pre-commit config#3618
Prathamesh8989 wants to merge 2 commits intopytorch:masterfrom
Prathamesh8989:clean-precommit-fix

Conversation

@Prathamesh8989
Copy link

@Prathamesh8989 Prathamesh8989 commented Mar 1, 2026

This is a fresh PR to replace #3585, ensuring a clean commit history as requested.

Changes:

  • Added nb-clean as the first hook to strip notebook outputs before formatting.

CC: @aaishwarymishra

@Prathamesh8989
Copy link
Author

I have updated the .pre-commit-config.yaml to include the nb-clean hook at the top of the repository list.

Verification performed:

  • Branch Alignment: Reset the branch to the specific commit 37e838427d82922008fdae47ce516ed0eb609020 as requested.
  • Format Check: Verified the presence of the trailing newline using tail -c 1 .pre-commit-config.yaml | xxd (confirmed 0d0a).
  • Local Test: Confirmed that the hook successfully strips execution counts while preserving cell outputs, matching the project requirements.

The configuration is clean and all CI checks are currently passing.

CC: @vfdev-5 for review and merging.

@aaishwarymishra
Copy link
Collaborator

@vfdev-5 this pr looks good.

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

@vfdev-5 vfdev-5 changed the title build: add nb-clean and ruff-check to pre-commit config Added nb-clean to pre-commit config Mar 3, 2026
@vfdev-5
Copy link
Collaborator

vfdev-5 commented Mar 3, 2026

Let's pass nb-clean on the codebase in this PR, squash all commits into one and add the commit into https://github.com/pytorch/ignite/blob/master/.git-blame-ignore-revs

@Prathamesh8989
Copy link
Author

Thanks for the guidance!

I’ll run nb-clean across the entire codebase in this PR, squash all commits into a single clean commit, and then add the resulting commit hash to .git-blame-ignore-revs as requested.

Will update the PR shortly. 👍

@github-actions github-actions bot added the examples Examples label Mar 3, 2026
@Prathamesh8989
Copy link
Author

Prathamesh8989 commented Mar 3, 2026

I have updated the PR with the following changes:

  • Ran nb-clean on all notebooks in the codebase.

  • Squashed all changes into a single clean commit with the corrected message: build: add nb-clean to pre-commit config and clean codebase.

  • Added the commit hash to .git-blame-ignore-revs.

All CI checks are passing. Ready for review! @vfdev-5 @aaishwarymishra

@aaishwarymishra
Copy link
Collaborator

aaishwarymishra commented Mar 4, 2026

I have updated the PR with the following changes:

  • Ran nb-clean on all notebooks in the codebase.
  • Squashed all changes into a single clean commit with the corrected message: build: add nb-clean to pre-commit config and clean codebase.
  • Added the commit hash to .git-blame-ignore-revs.

All CI checks are passing. Ready for review! @vfdev-5 @aaishwarymishra

I think you kinda got it wrong you have to squash all commits in one add the new commit hash to .git-blame-ignore-revs commit it again, you don't have to squash it again as it will change the commit , see git-blame-ignore-revs it has different commit hash than the actual one.

Co-authored-by: Aaishwarya Mishra <aaishwarymishra@gmail.com>
@Prathamesh8989
Copy link
Author

Thanks @aaishwarymishra! I've accepted the suggestion and updated the hash in .git-blame-ignore-revs. Everything should be aligned now.

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Mar 4, 2026

@Prathamesh8989 the code style check is failed, please take a look

@aaishwarymishra
Copy link
Collaborator

@Prathamesh8989 I ran pre-commit hook in your branch and pre-commit still modified files. rerun the pre-commit squash commits and add it to .git-blame-ignore-revs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants