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/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/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 00000000..2e7fb320 --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,17 @@ +name: prettier + +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 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 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