Skip to content

Commit

Permalink
chore: add comments on pr suggesting formatting (#181)
Browse files Browse the repository at this point in the history
* chore: add comments on pr suggesting formatting

This commit adds a step to the lua-format-check-pr job that will leave a
comment with "suggested changes" when formatting needs to be applied.
This can then be applied with one click (per file).

Alternatively, I could change it to automattically add a commit that
formats the code. Several PRs have gotten through without proper
formatting, which makes all future PRs fail the checks.

* fix: add styluaignore to protect third_party submodule

* fix: permissions in workflow

* fix: fail_on_error

* chore: apply formatting
  • Loading branch information
aarondill authored Jul 23, 2024
1 parent 835334b commit 3ae92fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/lua-format-check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ on:
pull_request:
paths:
- "**.lua"
permissions:
contents: read
checks: write
issues: write
pull-requests: write
jobs:
format_code:
runs-on: ubuntu-latest
Expand All @@ -12,4 +17,9 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check .
args: .
- name: suggester
uses: reviewdog/action-suggester@v1
with:
tool_name: stylua
fail_on_error: true
1 change: 1 addition & 0 deletions .styluaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua/tabnine/third_party/
2 changes: 1 addition & 1 deletion lua/tabnine/binary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function TabnineBinary:start()
"ide-restart-counter=" .. self.restart_counter,
"pluginVersion=" .. consts.plugin_version,
"--tls_config",
"insecure=" .. tostring(config.ignore_certificate_errors)
"insecure=" .. tostring(config.ignore_certificate_errors),
}, optional_args()),
stdio = { self.stdin, self.stdout, self.stderr },
}, function()
Expand Down

0 comments on commit 3ae92fc

Please sign in to comment.