[Feature]: Enforce formatting checks in CI for Go, Lua, shell and PowerShell

Aperta
#766 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
50/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, lua, powershell, shell

Direzione di ricerca

Start by running gofmt -l . on main to confirm internal/plugin/model_test.go is flagged, then format it. The config files are AGENTS.md and CONTRIBUTING.md (line 37), and .gitattributes covers the *.sh, *.ps1 and *.go files. Add the CI check for each language, plus stylua.toml and .editorconfig. Done when the new CI steps pass on the current tree and the Lua, shell and PowerShell files conform to the checks you add. The PowerShell tool choice is open, so confirm it with a maintainer before you start.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
1. Your usage scenarios?

Nothing enforces formatting, so files drift. Checked on main at c4f6275:

  • gofmt -l reports internal/plugin/model_test.go (struct literal alignment). internal/env/context_test.go was also unformatted at 37cff8f; a later commit changed it, but nothing in CI keeps files formatted.
  • No CI step runs gofmt or any other formatter. AGENTS.md asks contributors to run gofmt -w on changed Go files, and CONTRIBUTING.md (line 37) only says "You can try running go fmt and go vet".
  • There is no .editorconfig (indentation, final newline, trailing whitespace) and no stylua.toml, although 19 Lua files are tracked.
  • .gitattributes pins LF line endings for *.sh, *.ps1 and *.go. That protects line endings, not formatting.

The reference is version-fox/vfox-java. Its lint.yml runs gofmt -l and stylua --check ., and its stylua.toml sets indent_type = "Spaces", indent_width = 4, column_width = 120 and line_endings = "Unix".

2. What is your expected outcome?

A formatting check in CI for each language, with its configuration checked in:

  • Go: test -z "$(gofmt -l .)", after formatting internal/plugin/model_test.go.
  • Lua: stylua --check with a stylua.toml, applied to the existing Lua files.
  • Shell: shfmt -d for install.sh and scripts/*.sh.
  • PowerShell: a format check for the .ps1 files, for example PSScriptAnalyzer's formatting rules.
  • All text files: an .editorconfig, checked by a tool such as editorconfig-checker.

Linting is out of scope for this issue.

Lingua principale
Go
Stelle
4k
Fork
177
Merge medio
1g 20h
PR unite (30g)
31

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di version-fox/vfox

Tutte le issue di version-fox/vfox

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.