nanos-lint 2.5.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # nanos-lint
2
2
 
3
3
  [![CI](https://github.com/vugi99/nanos-lint/actions/workflows/ci.yml/badge.svg)](https://github.com/vugi99/nanos-lint/actions/workflows/ci.yml)
4
+ [![npm version](https://img.shields.io/npm/v/nanos-lint.svg)](https://www.npmjs.com/package/nanos-lint)
4
5
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D24-brightgreen.svg)](https://nodejs.org/)
5
6
  [![Lua Version](https://img.shields.io/badge/Lua-5.4.9-blue.svg)](https://www.lua.org/manual/5.4/)
6
7
  [![LuaLS Version](https://img.shields.io/badge/LuaLS-3.19.1-brightgreen.svg)](https://github.com/LuaLS/lua-language-server)
@@ -95,10 +96,12 @@ jobs:
95
96
  | `path` | Path to workspace directory or Lua file to check | `.` |
96
97
  | `checklevel` | Minimum severity to report (`Error`, `Warning`, `Information`, `Hint`) | `Warning` |
97
98
  | `config` | Path to a custom `.luarc.json` configuration file | `""` |
99
+ | `annotations` | Path to a custom `annotations.lua` file | `""` |
98
100
  | `ignore` | Files or directories to ignore (supports glob patterns, newline or comma separated) | `""` |
99
101
  | `luals-version` | Version of `lua-language-server` to use | `latest` |
100
102
  | `fail-on-error` | Fail the workflow step if diagnostics are found | `true` |
101
103
  | `quiet` | Suppress progress messages | `false` |
104
+ | `cache` | Whether to cache the LuaLS binary and annotations across workflow runs | `true` |
102
105
 
103
106
  When running inside GitHub Actions, `nanos-lint` automatically outputs **workflow annotations** (`::error` / `::warning`) that appear inline on PR diffs.
104
107
 
@@ -113,6 +116,7 @@ COMMANDS:
113
116
  check [path] Check a workspace or Lua file (default)
114
117
  init [path] Scaffold a .luarc.json configuration in the workspace (copies definitions to .nanos-lint/)
115
118
  download-luals [version] Download and cache the LuaLS binary
119
+ clean-cache, clean Clear the nanos-lint cache directory
116
120
  help, --help, -h Show help message
117
121
  version, --version, -v Show version information
118
122
 
@@ -120,6 +124,7 @@ OPTIONS:
120
124
  -i, --ignore <pattern> Files or directories to ignore (supports globs, repeatable, comma/newline-separated)
121
125
  --checklevel=<level> Minimum diagnostic level: Error, Warning, Information, Hint (default: Warning)
122
126
  --config=<path> Path to custom .luarc.json configuration file
127
+ --annotations=<path> Path to custom annotations.lua file
123
128
  --format=<format> Output format: pretty, json, github (default: pretty)
124
129
  --github Output in GitHub Actions format (shortcut for --format=github)
125
130
  --luals-version=<ver> Version of LuaLS to use (default: latest)
@@ -133,6 +138,8 @@ OPTIONS:
133
138
  | Variable | Description |
134
139
  | :--- | :--- |
135
140
  | `LUALS_BIN` | Explicit path to a pre-installed `lua-language-server` binary |
141
+ | `NANOS_ANNOTATIONS_PATH`, `NANOS_ANNOTATIONS` | Explicit path to a custom `annotations.lua` file |
142
+ | `GITHUB_TOKEN` | GitHub personal access token used for authenticated GitHub API requests (avoids unauthenticated rate limits) |
136
143
  | `NO_COLOR` | Disables ANSI color output when set to any non-empty value |
137
144
  | `FORCE_COLOR` | Forces ANSI color output even in non-TTY environments |
138
145
 
@@ -165,41 +172,38 @@ npx nanos-lint init --force
165
172
 
166
173
  ---
167
174
 
168
- ## Standalone Binary Distributions (Offline / CD)
175
+ ## Pre-packaged Release Distributions (Offline / CD)
169
176
 
170
- For environments without Node.js, pre-packaged release bundles containing the compiled `lua-language-server` binary and nanos-lint wrapper are available on the [Releases](https://github.com/vugi99/nanos-lint/releases) page:
177
+ Pre-packaged release bundles containing the platform's `lua-language-server` binary, vendored `annotations.lua`, and the nanos-lint CLI wrapper are available on the [Releases](https://github.com/vugi99/nanos-lint/releases) page:
171
178
 
172
179
  - `nanos-lint-<version>-windows-x64.zip`
173
180
  - `nanos-lint-<version>-linux-x64.tar.gz`
174
181
 
175
- Simply extract the archive and run `./nanos-lint` (Linux) or `nanos-lint.cmd` (Windows).
182
+ These bundles are fully self-contained and ready for offline CI/CD environments with Node.js installed, eliminating the need to download LuaLS or annotations at runtime. Simply extract the archive and run `./nanos-lint` (Linux) or `nanos-lint.cmd` (Windows).
176
183
 
177
184
  ---
178
185
 
179
186
  ## Development
180
187
 
181
188
  ```bash
182
- # Clone with submodules
183
- git clone --recursive https://github.com/vugi99/nanos-lint.git
189
+ # Clone the repository
190
+ git clone https://github.com/vugi99/nanos-lint.git
184
191
  cd nanos-lint
185
192
 
186
193
  # Install dependencies
187
194
  npm install
188
195
 
189
- # Update annotations submodule from upstream
190
- git submodule update --remote --merge
191
-
192
196
  # Run ESLint
193
197
  npm run lint
194
198
 
195
199
  # Run type check
196
200
  npm run typecheck
197
201
 
198
- # Run Vitest test suite (unit + live LuaLS integration tests)
199
- npm test
200
-
201
202
  # Build distribution bundle
202
203
  npm run build
204
+
205
+ # Run Vitest test suite with coverage (unit + live LuaLS integration tests)
206
+ npm run test:coverage
203
207
  ```
204
208
 
205
209
  See [AGENTS.md](AGENTS.md) for development philosophy and quality gate requirements.
package/action.yml CHANGED
@@ -18,6 +18,10 @@ inputs:
18
18
  description: 'Path to a custom .luarc.json configuration file'
19
19
  required: false
20
20
  default: ''
21
+ annotations:
22
+ description: 'Path to a custom annotations.lua file'
23
+ required: false
24
+ default: ''
21
25
  luals-version:
22
26
  description: 'Version of LuaLS to use (or "latest")'
23
27
  required: false
@@ -34,6 +38,10 @@ inputs:
34
38
  description: 'Files or directories to ignore (supports glob patterns, multiple entries can be newline or comma separated)'
35
39
  required: false
36
40
  default: ''
41
+ cache:
42
+ description: 'Whether to cache the LuaLS binary and annotations across workflow runs'
43
+ required: false
44
+ default: 'true'
37
45
 
38
46
  runs:
39
47
  using: 'composite'
@@ -43,12 +51,26 @@ runs:
43
51
  with:
44
52
  node-version: '24'
45
53
 
54
+ - name: Cache LuaLS binary and annotations
55
+ if: ${{ inputs.cache != 'false' }}
56
+ uses: actions/cache@v6
57
+ with:
58
+ path: |
59
+ ~/.cache/nanos-lint
60
+ ~/AppData/Local/nanos-lint
61
+ ~/Library/Caches/nanos-lint
62
+ key: nanos-lint-${{ runner.os }}-${{ inputs.luals-version }}
63
+ restore-keys: |
64
+ nanos-lint-${{ runner.os }}-${{ inputs.luals-version }}-
65
+ nanos-lint-${{ runner.os }}-
66
+
46
67
  - name: Run nanos-lint
47
68
  shell: bash
48
69
  env:
49
70
  INPUT_PATH: ${{ inputs.path }}
50
71
  INPUT_CHECKLEVEL: ${{ inputs.checklevel }}
51
72
  INPUT_CONFIG: ${{ inputs.config }}
73
+ INPUT_ANNOTATIONS: ${{ inputs.annotations }}
52
74
  INPUT_LUALS_VERSION: ${{ inputs.luals-version }}
53
75
  INPUT_FAIL_ON_ERROR: ${{ inputs.fail-on-error }}
54
76
  INPUT_QUIET: ${{ inputs.quiet }}
@@ -61,6 +83,10 @@ runs:
61
83
  ARGS+=("--config=$INPUT_CONFIG")
62
84
  fi
63
85
 
86
+ if [ -n "$INPUT_ANNOTATIONS" ]; then
87
+ ARGS+=("--annotations=$INPUT_ANNOTATIONS")
88
+ fi
89
+
64
90
  if [ -n "$INPUT_IGNORE" ]; then
65
91
  while IFS= read -r line || [ -n "$line" ]; do
66
92
  trimmed=$(echo "$line" | xargs)
@@ -81,7 +107,7 @@ runs:
81
107
  if [ -f "$ACTION_PATH/dist/cli.js" ]; then
82
108
  node "$ACTION_PATH/dist/cli.js" "${ARGS[@]}"
83
109
  else
84
- npx --yes nanos-lint@^2.1.0 "${ARGS[@]}"
110
+ npx --yes nanos-lint@^2.6.1 "${ARGS[@]}"
85
111
  fi
86
112
 
87
113