From abbb251e370039fc06f6f93c5832db5355a115ad Mon Sep 17 00:00:00 2001 From: NStefan002 Date: Fri, 16 May 2025 00:12:14 +0200 Subject: [PATCH 1/4] chore: add config files for `markdownlint`, `prettier`, and `stylua` --- .markdownlint.yaml | 13 +++++++++++++ .prettierrc | 5 +++++ stylua.toml | 5 +++++ 3 files changed, 23 insertions(+) create mode 100644 .markdownlint.yaml create mode 100644 .prettierrc create mode 100644 stylua.toml diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 00000000..3455a4e4 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,13 @@ +MD013: + line_length: 120 + tables: false +MD033: + allowed_elements: + - "details" + - "summary" + - "b" + - "table" + - "tr" + - "td" + - "a" +MD049: false diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..0fd60653 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "printWidth": 120, + "proseWrap": "always", + "tabWidth": 2 +} diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 00000000..6376ab81 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,5 @@ +indent_type = "Spaces" +indent_width = 4 +column_width = 100 +quote_style = "AutoPreferDouble" +no_call_parentheses = false From 70b23419c6fd3270ddf9aa9bedbb65298a2cc1f9 Mon Sep 17 00:00:00 2001 From: NStefan002 Date: Fri, 16 May 2025 00:21:31 +0200 Subject: [PATCH 2/4] ci: add `markdownlint` and `stylua` gh actions --- .github/workflows/markdownlint.yml | 12 ++++++++++++ .github/workflows/stylua.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/markdownlint.yml create mode 100644 .github/workflows/stylua.yml diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml new file mode 100644 index 00000000..44e3a6f4 --- /dev/null +++ b/.github/workflows/markdownlint.yml @@ -0,0 +1,12 @@ +name: markdownlint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DavidAnson/markdownlint-cli2-action@v19 + with: + globs: '**/*.md' diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml new file mode 100644 index 00000000..ef739815 --- /dev/null +++ b/.github/workflows/stylua.yml @@ -0,0 +1,26 @@ +name: stylua + +on: [push, pull_request] + +jobs: + format: + name: Stylua + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: date +%W > weekly + + - name: Restore cache + id: cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin + key: ${{ runner.os }}-cargo-${{ hashFiles('weekly') }} + + - name: Install + if: steps.cache.outputs.cache-hit != 'true' + run: cargo install stylua + + - name: Format + run: stylua --check lua/ --config-path=stylua.toml From e81467beb5ee5e327d858c207f1c90b3afd411b5 Mon Sep 17 00:00:00 2001 From: NStefan002 Date: Tue, 20 May 2025 01:09:57 +0200 Subject: [PATCH 3/4] ci(prettier): add `prettier` format check for markdown files --- .github/workflows/prettier.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/prettier.yml diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 00000000..40c96a05 --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,17 @@ +name: Continuous Integration + +on: [push, pull_request] + +jobs: + prettier: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prettify code + uses: creyD/prettier_action@v4.5 + with: + dry: true + prettier_options: --check **/*.md From e667c63f97808f10320a90aa2fdbdf28201c76a5 Mon Sep 17 00:00:00 2001 From: NStefan002 Date: Tue, 20 May 2025 01:12:11 +0200 Subject: [PATCH 4/4] ci: renames --- .github/workflows/{build.yml => luacheck.yml} | 4 ++-- .github/workflows/prettier.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{build.yml => luacheck.yml} (93%) diff --git a/.github/workflows/build.yml b/.github/workflows/luacheck.yml similarity index 93% rename from .github/workflows/build.yml rename to .github/workflows/luacheck.yml index bdb08e19..648adb2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/luacheck.yml @@ -2,12 +2,12 @@ name: luacheck -# Controls when the action will run. +# Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch push: branches: - - '*' + - '*' paths: - '**.lua' pull_request: diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 40c96a05..2e7fb320 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -1,4 +1,4 @@ -name: Continuous Integration +name: prettier on: [push, pull_request]