From ff473189ac2c17cd30b32373cf61762de1bd59cb Mon Sep 17 00:00:00 2001 From: Marcin Federowicz Date: Sat, 7 Oct 2023 00:17:09 +0200 Subject: [PATCH 1/5] pre-commit - basic config and hook --- .pre-commit-config.yaml | 10 ++++++++++ .pre-commit-hooks.yaml | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..4ffbe1d7d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: end-of-file-fixer + - repo: https://github.com/mgechev/revive + #for start use dev tag, after development we switch to proper tags with versions + rev: dev-pre-commit + hooks: + - id: revive diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 000000000..ec7aaa3a6 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,5 @@ +- id: revive + name: revive + description: Beautiful Go linter + entry: revive + language: golang From a0fddd46729fbf837aa6099b08ca5b2a3e9068b4 Mon Sep 17 00:00:00 2001 From: Marcin Federowicz Date: Sat, 7 Oct 2023 02:09:35 +0200 Subject: [PATCH 2/5] disable pre-hooks --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4ffbe1d7d..fabf4c4fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,8 @@ repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: end-of-file-fixer + # - repo: https://github.com/pre-commit/pre-commit-hooks + # rev: v4.4.0 + # hooks: + # - id: end-of-file-fixer - repo: https://github.com/mgechev/revive #for start use dev tag, after development we switch to proper tags with versions rev: dev-pre-commit From ced79cf87c3a51f681ba929171bdbc446d76423b Mon Sep 17 00:00:00 2001 From: Marcin Federowicz Date: Sat, 7 Oct 2023 02:17:55 +0200 Subject: [PATCH 3/5] tests hoook --- .pre-commit-config.yaml | 2 +- .pre-commit-hooks.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fabf4c4fa..18e581a11 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: # rev: v4.4.0 # hooks: # - id: end-of-file-fixer - - repo: https://github.com/mgechev/revive + - repo: https://github.com/mfederowicz/revive #for start use dev tag, after development we switch to proper tags with versions rev: dev-pre-commit hooks: diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index ec7aaa3a6..5cb34adab 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,5 +1,5 @@ - id: revive name: revive description: Beautiful Go linter - entry: revive + entry: revive -h language: golang From 790be255a264b3a4b9bf0a9a97c2627ad1a0096c Mon Sep 17 00:00:00 2001 From: Marcin Federowicz Date: Sat, 7 Oct 2023 13:45:02 +0200 Subject: [PATCH 4/5] basic hooks --- .pre-commit-config.yaml | 12 ++++-------- .pre-commit-hooks.yaml | 5 ----- 2 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 18e581a11..c7e4bb921 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,6 @@ repos: - # - repo: https://github.com/pre-commit/pre-commit-hooks - # rev: v4.4.0 - # hooks: - # - id: end-of-file-fixer - - repo: https://github.com/mfederowicz/revive - #for start use dev tag, after development we switch to proper tags with versions - rev: dev-pre-commit + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 hooks: - - id: revive + - id: end-of-file-fixer + - id: trailing-whitespace diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml deleted file mode 100644 index 5cb34adab..000000000 --- a/.pre-commit-hooks.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- id: revive - name: revive - description: Beautiful Go linter - entry: revive -h - language: golang From 1d5b3ee751970364e748bdf10377ecea17ef8e27 Mon Sep 17 00:00:00 2001 From: Marcin Federowicz Date: Sat, 7 Oct 2023 14:55:52 +0200 Subject: [PATCH 5/5] pre-commit: hooks from https://github.com/TekWizely/pre-commit-golang --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c7e4bb921..d1c3bdbcb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,3 +4,9 @@ repos: hooks: - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/TekWizely/pre-commit-golang + rev: v1.0.0-rc.1 + hooks: + - id: go-revive + - id: go-revive-mod + - id: go-revive-repo-mod