-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: style, lint dev: precommit, style, lint, editorconfig (#218)
* add stylua, luacheck, luarc, editorconfig, pre-commit hooks * add stylua, luacheck, luarc, editorconfig, pre-commit hooks * add comments before icons_by_filename and icons_by_file_extension * stylua nit for generated light * correct luacheck stylua order in contributing.md * add stylua/luacheck OS package notes * use make instead of pre-commit hooks * document prerequisites * remove setup-hooks.sh * ci: add pre-commit configuration and GHA (#233) * ci: add pre-commit configuration * ci: add GHA to autoupdate pre-commit hooks --------- Co-authored-by: gegoune <[email protected]>
- Loading branch information
1 parent
585dbc2
commit 4970f75
Showing
12 changed files
with
216 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
insert_final_newline = true | ||
end_of_line = lf | ||
|
||
[*.lua] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Pre-commit autoupdate | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
auto-update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
- run: pip install pre-commit | ||
shell: bash | ||
- run: pre-commit autoupdate | ||
shell: bash | ||
- run: pre-commit run --all-files | ||
shell: bash | ||
- uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: update/pre-commit-hooks | ||
title: "chore: update pre-commit hooks" | ||
commit-message: "chore: update pre-commit hooks" | ||
body: Update versions of pre-commit hooks to latest version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
max_line_length = 120 | ||
|
||
globals = { | ||
"vim", | ||
"jit", | ||
"bit", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", | ||
"runtime.version" : "Lua 5.1", | ||
"diagnostics": { | ||
"globals": [ | ||
"vim", | ||
"jit", | ||
"bit" | ||
] | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
repos: | ||
- repo: https://github.com/johnnymorganz/stylua | ||
rev: v0.17.0 | ||
hooks: | ||
- id: stylua-github | ||
- repo: local | ||
hooks: | ||
- id: luacheck | ||
name: Luacheck | ||
description: Lints Lua files using Luacheck. | ||
entry: luacheck -- | ||
language: system | ||
types: [lua] | ||
- repo: local | ||
hooks: | ||
- id: lighttheme | ||
name: Light Color Scheme Generator | ||
description: Ensures Light Color Scheme version has been generated. | ||
entry: nvim --headless -c 'source scripts/generate_colors.lua' -c 'qall' | ||
language: system | ||
types: [lua] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
column_width = 120 | ||
line_endings = "Unix" | ||
indent_type = "Spaces" | ||
indent_width = 2 | ||
quote_style = "AutoPreferDouble" | ||
call_parentheses = "None" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
all: colors style-check lint | ||
|
||
colors: | ||
nvim --headless -c 'source scripts/generate_colors.lua' -c 'qall' | ||
|
||
all: colors | ||
style-check: | ||
stylua . --check | ||
|
||
style-fix: | ||
stylua . | ||
|
||
lint: | ||
luacheck . | ||
|
||
.PHONY: all colors style-check style-fix lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.