From bc3ce343a89a1ab7d9c4b71d89923c670dff69d8 Mon Sep 17 00:00:00 2001 From: Smirnov Oleksandr Date: Thu, 20 Jul 2023 00:11:59 +0300 Subject: [PATCH] update tooling (#38) * chore: delete pre-commit * chore: switch from makefile to taskfile * chore(ci): update and add one more linter * chore(editorconfig): add config for Go * chore(editorconfig): remove max_line_length * fix: editorconfig-check on README.md --- .editorconfig | 6 ++++-- .github/workflows/ci.yml | 24 ------------------------ .github/workflows/linters.yml | 22 ++++++++++++++++++++++ .pre-commit-config.yaml | 15 --------------- Makefile | 11 ----------- README.md | 2 +- Taskfile.yml | 29 +++++++++++++++++++++++++++++ 7 files changed, 56 insertions(+), 53 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/linters.yml delete mode 100644 .pre-commit-config.yaml delete mode 100644 Makefile create mode 100644 Taskfile.yml diff --git a/.editorconfig b/.editorconfig index 48ce80f..3155057 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,11 +7,13 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace=true charset = utf-8 -max_line_length = 120 [*.{lua,vim}] -max_line_length = 100 indent_size = 2 [*.{md,yml,yaml,toml}] indent_size = 2 + +[*.go] +indent_style = tab +indent_size = 4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index b1be903..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Format and lint -on: [push, pull_request] - -jobs: - format: - name: stylua - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: JohnnyMorganz/stylua-action@1.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: 0.14.0 - args: --check . - - lint: - name: selene - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: NTBBloodbath/selene-action@v1.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --display-style=quiet . diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 0000000..53b28ab --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,22 @@ +name: linters +on: [push, pull_request] + +jobs: + linters: + name: linters + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: JohnnyMorganz/stylua-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . + + - uses: NTBBloodbath/selene-action@v1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: . + + - uses: editorconfig-checker/action-editorconfig-checker@main + - run: editorconfig-checker diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 464c44d..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,15 +0,0 @@ -repos: -- repo: local - hooks: - - id: stylua - name: StyLua - language: rust - entry: stylua - types: [lua] - args: ["--check", "-"] - - id: selene - name: Selene - language: rust - entry: selene - types: [lua] - args: ["-"] diff --git a/Makefile b/Makefile deleted file mode 100644 index 2dc03c4..0000000 --- a/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -.PHONY: -.SILENT: - -format: - stylua **/*.lua - -lint: - selene **/*.lua - -test: - nvim --headless -u ./spec/minimal_init.vim -c "PlenaryBustedDirectory spec {minimal_init='./spec/minimal_init.vim'}" diff --git a/README.md b/README.md index 9809686..3c13fa0 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ It will install next tools: - [iferr](https://github.com/koron/iferr) 2. Modify struct tags: - By default `json` tag will be added/removed, if not set: + By default `json` tag will be added/removed, if not set: ```vim :GoTagAdd json " For add json tag diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..2f3b8c4 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,29 @@ +version: "3" +tasks: + format: + desc: formats all lua files in repo + cmds: [stylua .] + + lint: + desc: runs all linters + cmds: + - task: lint_lua + - task: lint_editorconfig + + lint_lua: + desc: runs lua linter on all repo + cmds: [selene .] + + lint_editorconfig: + desc: runs editorconfig-checker + cmds: [editorconfig-checker] + + test: + aliases: [tests, spec] + cmds: + - | + nvim --headless \ + -u ./spec/minimal_init.vim\ + -c "PlenaryBustedDirectory spec \ + {minimal_init='./spec/minimal_init.lua'\ + ,sequential=true}"