Skip to content

Commit

Permalink
Replace stylua with yamlfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cschindlbeck committed Dec 26, 2024
1 parent be23112 commit e48541f
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 41 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: lint

on: [push]
# on:
# pull_request:
Expand All @@ -10,25 +10,23 @@ jobs:
lint:
runs-on: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup
run: |
sudo apt-get update
sudo apt-get install luarocks
sudo luarocks install luacheck
- name: Lint
run: luacheck lua/

- name: Checkout code
uses: actions/checkout@v2
- name: Setup
run: |
sudo apt-get update
sudo apt-get install luarocks
sudo luarocks install luacheck
- name: Lint
run: luacheck lua/
format:
runs-on: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run stylua
uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest # NOTE: we recommend pinning to a specific version in case of formatting changes
# CLI arguments
args: --check .
- uses: actions/checkout@v4
- name: yamllint
uses: reviewdog/action-yamllint@v1
with:
github_token: ${{ secrets.github_token }}
fail_on_error: true
- name: yamlfmt
uses: yk-lab/yamlfmt-action@v1.0.0
1 change: 0 additions & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
# Default state for all rules
default: true

# MD013/line-length - Line length
MD013:
line_length: 120
Expand Down
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# To use:
#
# pre-commit run -a
Expand All @@ -11,7 +12,6 @@
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit
---
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -31,7 +31,6 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- id: fix-byte-order-marker

# Spellcheck in comments and docs
# skipping of *.svg files is not working...
- repo: https://github.com/codespell-project/codespell
Expand All @@ -40,18 +39,14 @@ repos:
- id: codespell
args: ["--write-changes"]
exclude: CHANGELOG\.rst|\.(svg|pyc|drawio|dcf|eds)$|lazy-lock.json|example.lua

- repo: https://github.com/Calinou/pre-commit-luacheck
rev: v1.0.0
hooks:
- id: luacheck

- repo: https://github.com/JohnnyMorganz/StyLua
rev: v0.20.0
- repo: https://github.com/google/yamlfmt
rev: v0.10.0
hooks:
- id: stylua # or stylua-system / stylua-github
args: ["."]

- id: yamlfmt
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
Expand Down
7 changes: 7 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
formatter:
type: basic
include_document_start: true
max_line_length: 120
retain_line_breaks_single: true
indentless_arrays: false
pad_line_comments: 2
18 changes: 12 additions & 6 deletions lua/plugins/lsp-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,21 @@ return {
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*",
["http://json.schemastore.org/kustomization"] = "kustomization.{yml,yaml}",
["http://json.schemastore.org/prettierrc"] = ".prettierrc.{yml,yaml}",
["https://github.com/flux-iac/tofu-controller/releases/download/v0.15.1/tf-controller.crds.yaml"] = "tf-controller.crds.yaml",
["https://github.com/fluxcd/kustomize-controller/releases/download/v1.3.0/kustomize-controller.crds.yaml"] = "kustomize-controller.crds.yaml",
["https://github.com/fluxcd/source-controller/releases/download/v1.3.0/source-controller.crds.yaml"] = "source-controller.crds.yaml",
["https://github.com/flux-iac/tofu-controller/releases/download/v0.15.1/tf-controller.crds.yaml"] =
"tf-controller.crds.yaml",
["https://github.com/fluxcd/kustomize-controller/releases/download/v1.3.0/kustomize-controller.crds.yaml"] =
"kustomize-controller.crds.yaml",
["https://github.com/fluxcd/source-controller/releases/download/v1.3.0/source-controller.crds.yaml"] =
"source-controller.crds.yaml",
["https://json.schemastore.org/dependabot-2.0"] = ".github/dependabot.{yml,yaml}",
["https://json.schemastore.org/drone"] = ".drone.{yml,yaml}",
["https://json.schemastore.org/gitlab-ci"] = "*gitlab-ci*.{yml,yaml}",
["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] = "*api*.{yml,yaml}",
["https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json"] = "*flow*.{yml,yaml}",
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = "*docker-compose*.{yml,yaml}",
["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] =
"*api*.{yml,yaml}",
["https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json"] =
"*flow*.{yml,yaml}",
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] =
"*docker-compose*.{yml,yaml}",
},
},
},
Expand Down
4 changes: 0 additions & 4 deletions stylua.toml

This file was deleted.

0 comments on commit e48541f

Please sign in to comment.