From a9a46604eeb7e4dba463fb0c0c709556a8b630d8 Mon Sep 17 00:00:00 2001 From: Daniele Esposti Date: Sun, 3 Mar 2019 17:41:22 +0000 Subject: [PATCH 1/5] Stash/pop unstaged changes on commit --- .githooks/pre-commit | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 91cc845..3e8ee52 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,4 +1,10 @@ -#!/bin/bash +#!/bin/bash -eu + +changes=$(git diff) + +if [ ! -z "$changes" ] ; then + git stash save --keep-index 1> /dev/null +fi # Rebuild bins if necessary bin_files=$(git diff --cached --name-only --diff-filter=ACM "*ast_to_js.*" | tr '\n' ' ') @@ -24,4 +30,8 @@ if [ -n "$py_files" ] ; then echo "$py_files" | xargs git add fi +if [ ! -z "$changes" ] ; then + git stash pop 1> /dev/null +fi + exit 0 From 248e1ee9215864df9d55b26802bd711e085c7afa Mon Sep 17 00:00:00 2001 From: Daniele Esposti Date: Sun, 3 Mar 2019 12:35:25 +0000 Subject: [PATCH 2/5] Exclude node_modules from formatting --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8943250..380e9e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,6 @@ line-length = 99 py36 = true exclude = ''' /( - \.git + \.git|node_modules )/ ''' From c97d0b4b33a1bb2892818a12d4a890340512e916 Mon Sep 17 00:00:00 2001 From: Daniele Esposti Date: Sun, 3 Mar 2019 13:34:04 +0000 Subject: [PATCH 3/5] Fixed wrong dir in template to AST conversion --- scripts/build_js_ast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_js_ast.js b/scripts/build_js_ast.js index 1176b06..3925823 100644 --- a/scripts/build_js_ast.js +++ b/scripts/build_js_ast.js @@ -69,4 +69,4 @@ const buildAst = (astDir: string) => { }); }; -["javascript", "flow"].map(v => path.join(BASE_AST_DIR, v)).forEach(buildAst); +["javascript_flow", "flow"].map(v => path.join(BASE_AST_DIR, v)).forEach(buildAst); From 9fa66b474b3ad6cb611fdbce1acfc995ce2111b1 Mon Sep 17 00:00:00 2001 From: Daniele Esposti Date: Sun, 3 Mar 2019 13:34:47 +0000 Subject: [PATCH 4/5] Format AST files after generation --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 253dde8..78fcdde 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "webpack-cli": "^3.0.7" }, "scripts": { - "build:test:js": "babel-node scripts/build_js_ast.js", + "build:test:js": "babel-node scripts/build_js_ast.js && npm run code:format tests/**/*.json", "code:format": "prettier --write", "build:bin": "webpack --config config/ast_to_js.webpack.config.js && chmod +x bin/ast_to_js" } From 6eb1cd6399e835fb2f1752004b0cf3295f7d190e Mon Sep 17 00:00:00 2001 From: Daniele Esposti Date: Mon, 4 Mar 2019 00:56:30 +0000 Subject: [PATCH 5/5] Updated CHANGES --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index bdea837..b7571f6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ### Trivial/internal changes - [#21](https://github.com/expobrain/json-schema-codegen/pull/21) Fixed anchors in README +- [#22](https://github.com/expobrain/json-schema-codegen/pull/22) Various internal improvements and fixes ## v0.3.0