Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

  • Add pre-commit as a dev dependency to pyproject.toml
  • Create .pre-commit-config.yaml with jupyter nbconvert hook
  • Update Makefile with pre-commit commands (install, run)
  • Clear existing outputs from notebooks with execution counts/outputs
  • Update README with pre-commit setup instructions
  • Test pre-commit hook manually
  • Remove tests per maintainer feedback
  • Fix hook to use python -m jupyter for better environment compatibility
  • Make pre-commit-install depend on setup in Makefile
  • Clean notebooks that had outputs committed after hook was added
Original prompt

This section details on the original issue you should resolve

<issue_title>Cleanup jupyter pre commit hook</issue_title>
<issue_description>The solution notebook includes execution outputs and execution counts, which should typically be cleared before committing to version control. This prevents merge conflicts and keeps the repository clean. Consider adding a pre-commit hook or using jupyter nbconvert --clear-output to strip outputs.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@nadvolod
Copy link
Collaborator

we don't need any tests please @copilot

Copilot AI changed the title [WIP] Add pre-commit hook for Jupyter notebook cleanup Add pre-commit hook to strip Jupyter notebook outputs Oct 28, 2025
Copilot AI requested a review from nadvolod October 28, 2025 11:35
Copilot finished work on behalf of nadvolod October 28, 2025 11:35
Copy link
Contributor Author

Copilot AI commented Oct 28, 2025

we don't need any tests please @copilot

Removed the test file in commit 035fc3e.

Copilot finished work on behalf of nadvolod October 28, 2025 11:39
@nadvolod
Copy link
Collaborator

The pre-commit is clearly not working: cbe9ab0
@copilot

Copy link
Contributor Author

Copilot AI commented Oct 28, 2025

The pre-commit is clearly not working: cbe9ab0
@copilot

Fixed in commits cb4a2dd and f179e89. The issue was that the hook used jupyter command which wasn't in the PATH. Changed to use python -m jupyter nbconvert which works with the installed Python environment. Also made make pre-commit-install depend on make setup to ensure dependencies are installed first.

The hook now works correctly - notebooks from cbe9ab0 have been cleaned.

Copilot finished work on behalf of nadvolod October 28, 2025 18:32
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.

Cleanup jupyter pre commit hook

2 participants