Follow-up on the new pre-commit hook #724
Conversation
Codecov Report
@@ Coverage Diff @@
## master #724 +/- ##
==========================================
- Coverage 99.12% 99.10% -0.02%
==========================================
Files 97 104 +7
Lines 9591 9862 +271
==========================================
+ Hits 9507 9774 +267
- Misses 84 88 +4
Continue to review full report at Codecov.
|
|
@asottile was kind enough to give us some feedback to pre-commit hook when I added it to the list of known pre-commit hooks: pre-commit/pre-commit.com#451 (comment) |
3c369e0
to
2a61551
and recommend the pre-commit framework
…ost recent version
The example fails because Jupytext rewrites the ipynb file:
[jupytext] Updating 'test.ipynb' with this change:
E @@ -5,10 +5,10 @@
E "execution_count": 1,
E "metadata": {
E "execution": {
E - "iopub.execute_input": "2021-01-26T22:24:31.954956Z",
E - "iopub.status.busy": "2021-01-26T22:24:31.949570Z",
E - "iopub.status.idle": "2021-01-26T22:24:31.979381Z",
E - "shell.execute_reply": "2021-01-26T22:24:31.978412Z"
E + "iopub.execute_input": "2021-01-26T22:24:34.617791Z",
E + "iopub.status.busy": "2021-01-26T22:24:34.614232Z",
E + "iopub.status.idle": "2021-01-26T22:24:34.619679Z",
E + "shell.execute_reply": "2021-01-26T22:24:34.619940Z"
E }
E },
E "outputs": [
Should fix "Unknown option --markdown-headings"
|
|
||
| # finally we move the paired notebook to a subfolder | ||
| tmpdir.mkdir("subfolder") | ||
| os.rename("test.py", "subfolder/test.py") |
Skylion007
Feb 2, 2021
Contributor
NIT: shutil.move should be used instead of os.rename . This can fail if you keep your git repos on a different drive/partition/filesystem from your tmpdir. Additionally, in cases like this where the filename remains the same, you can just specify the folder.
NIT: shutil.move should be used instead of os.rename . This can fail if you keep your git repos on a different drive/partition/filesystem from your tmpdir. Additionally, in cases like this where the filename remains the same, you can just specify the folder.
and show paths with shlex.quote
|
@Skylion007 , @JohnPaton this version seems to work pretty well. If that sounds ok for you I'll merge this and release Jupytext v1.10.0, the first official tag with the pre-commit hook! |


Will close #722