From 6d672bcc8225fbd3882dc974af2434ef4f2c909a Mon Sep 17 00:00:00 2001 From: Nikoleta Glynatsi Date: Thu, 1 Aug 2019 11:27:18 +0100 Subject: [PATCH 1/5] adds a pre-commit-hook yaml file --- .pre-commit-hooks.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..0e4507f --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,8 @@ +- id: blackbook + name: blackbook + description: "`Black` for Jupyter notebooks." + entry: blackbook . + language: python + language_version: python3 + require_serial: true + types: [python] \ No newline at end of file From 7b5fb18ced2e8c482ecc8eb2b2c5494f892075b1 Mon Sep 17 00:00:00 2001 From: Nikoleta Glynatsi Date: Thu, 1 Aug 2019 11:53:58 +0100 Subject: [PATCH 2/5] change type from python to notebook --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 0e4507f..0f1ac5e 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -5,4 +5,4 @@ language: python language_version: python3 require_serial: true - types: [python] \ No newline at end of file + types: [notebook] \ No newline at end of file From 104fcb7dbbad4164fd7096dc0993cf7a6ece3026 Mon Sep 17 00:00:00 2001 From: Nikoleta Glynatsi Date: Thu, 1 Aug 2019 12:21:00 +0100 Subject: [PATCH 3/5] change type to file type notebook does not exist. use file instead --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 0f1ac5e..8eac2ea 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -5,4 +5,4 @@ language: python language_version: python3 require_serial: true - types: [notebook] \ No newline at end of file + files: '*\.ipynb$' \ No newline at end of file From 2f8c2afe34cc08494b5c73de48c45250377feb77 Mon Sep 17 00:00:00 2001 From: Henry Wilde Date: Thu, 1 Aug 2019 14:11:30 +0100 Subject: [PATCH 4/5] Fix regex and ignore ipynb_checkpoints in yaml. --- .pre-commit-hooks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 8eac2ea..7bbc702 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -5,4 +5,5 @@ language: python language_version: python3 require_serial: true - files: '*\.ipynb$' \ No newline at end of file + files: '.*\.ipynb' + exclude: '.*\ipynb_checkpoints' From b2b8f8fd90944a4a4a73bfafe94622a94d6287e8 Mon Sep 17 00:00:00 2001 From: Henry Wilde Date: Thu, 1 Aug 2019 14:14:14 +0100 Subject: [PATCH 5/5] Remove exclusion for checkpoints from yaml. --- .pre-commit-hooks.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 7bbc702..491e07d 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -6,4 +6,3 @@ language_version: python3 require_serial: true files: '.*\.ipynb' - exclude: '.*\ipynb_checkpoints'