tally-cli 0.6.0 → 0.7.0

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.
Files changed (2) hide show
  1. package/README.md +15 -162
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -41,9 +41,9 @@ tally integrates rules from multiple sources:
41
41
  <!-- BEGIN RULES_TABLE -->
42
42
  | Source | Rules | Description |
43
43
  |--------|-------|-------------|
44
- | **[BuildKit](https://docs.docker.com/reference/build-checks/)** | 12/22 rules | Docker's official Dockerfile checks (captured + reimplemented) |
45
- | **tally** | 5 rules | Custom rules including secret detection with [gitleaks](https://github.com/gitleaks/gitleaks) |
46
- | **[Hadolint](https://github.com/hadolint/hadolint)** | 27 rules | Hadolint-compatible Dockerfile rules (expanding) |
44
+ | **[BuildKit](https://docs.docker.com/reference/build-checks/)** | 14/22 rules | Docker's official Dockerfile checks (captured + reimplemented) |
45
+ | **tally** | 8 rules | Custom rules including secret detection with [gitleaks](https://github.com/gitleaks/gitleaks) |
46
+ | **[Hadolint](https://github.com/hadolint/hadolint)** | 31 rules | Hadolint-compatible Dockerfile rules (expanding) |
47
47
  <!-- END RULES_TABLE -->
48
48
 
49
49
  **See [RULES.md](RULES.md) for the complete rules reference.**
@@ -167,187 +167,40 @@ EOF
167
167
 
168
168
  ## Ignoring Violations
169
169
 
170
- You can suppress specific violations using inline comment directives.
171
-
172
- ### Next-Line Directives
173
-
174
- Suppress violations on the next line:
170
+ Suppress specific violations using inline comment directives:
175
171
 
176
172
  ```dockerfile
177
173
  # tally ignore=StageNameCasing
178
174
  FROM alpine AS Build
179
- ```
180
-
181
- ### Global Directives
182
175
 
183
- Suppress violations throughout the entire file:
184
-
185
- ```dockerfile
186
- # tally global ignore=max-lines
176
+ # tally global ignore=max-lines;reason=Generated file
187
177
  FROM alpine
188
- # ... rest of file is not checked for max-lines
189
- ```
190
-
191
- ### Multiple Rules
192
-
193
- Suppress multiple rules with comma-separated values:
194
-
195
- ```dockerfile
196
- # tally ignore=StageNameCasing,DL3006
197
- FROM Ubuntu AS Build
198
178
  ```
199
179
 
200
- ### Adding Reasons
201
-
202
- Document why a rule is being ignored using `;reason=` (BuildKit-style separator):
180
+ tally also supports `hadolint` and `check=skip` directive formats for easy migration.
203
181
 
204
- ```dockerfile
205
- # tally ignore=DL3006;reason=Using older base image for compatibility
206
- FROM ubuntu:16.04
207
-
208
- # tally global ignore=max-lines;reason=Generated file, size is expected
209
- FROM alpine
210
-
211
- # check=skip=StageNameCasing;reason=Legacy naming convention
212
- FROM alpine AS Build
213
- ```
214
-
215
- Use `--require-reason` to enforce that all ignore directives include an explanation:
216
-
217
- ```bash
218
- tally check --require-reason Dockerfile
219
- ```
220
-
221
- Note: The `;reason=` syntax is a tally extension that works with all directive formats. BuildKit silently ignores the `reason` option.
222
-
223
- ### Migration Compatibility
224
-
225
- tally supports directive formats from other linters for easy migration:
226
-
227
- ```dockerfile
228
- # hadolint ignore=DL3006
229
- FROM ubuntu
230
-
231
- # hadolint global ignore=DL3008
232
- FROM alpine
233
-
234
- # check=skip=StageNameCasing
235
- FROM alpine AS Build
236
- ```
237
-
238
- ### Suppressing All Rules
239
-
240
- Use `all` to suppress all rules on a line:
241
-
242
- ```dockerfile
243
- # tally ignore=all
244
- FROM Ubuntu AS Build
245
- ```
246
-
247
- ### CLI Options
248
-
249
- | Flag | Description |
250
- | -------------------------- | ---------------------------------------------------------- |
251
- | `--no-inline-directives` | Disable processing of inline ignore directives |
252
- | `--warn-unused-directives` | Warn about directives that don't suppress any violations |
253
- | `--require-reason` | Warn about ignore directives without `reason=` explanation |
254
-
255
- ### Configuration
256
-
257
- Inline directive behavior can be configured in `.tally.toml`:
258
-
259
- ```toml
260
- [inline-directives]
261
- enabled = true # Process inline directives (default: true)
262
- warn-unused = false # Warn about unused directives (default: false)
263
- validate-rules = false # Warn about unknown rule codes (default: false)
264
- require-reason = false # Require reason= on all ignore directives (default: false)
265
- ```
182
+ **See [Configuration Guide](docs/guide/configuration.md#inline-directives) for full directive syntax.**
266
183
 
267
184
  ## Configuration
268
185
 
269
- tally supports configuration via TOML config files, environment variables, and CLI flags.
270
-
271
- ### Config File
272
-
273
- Create a `.tally.toml` or `tally.toml` file in your project:
186
+ Create a `.tally.toml` in your project:
274
187
 
275
188
  ```toml
276
189
  [output]
277
- format = "text" # text, json, sarif, github-actions, markdown
278
- path = "stdout" # stdout, stderr, or file path
279
- show-source = true # Show source code snippets
280
- fail-level = "style" # Minimum severity for exit code 1
190
+ format = "text"
191
+ fail-level = "warning"
281
192
 
282
- # Rule selection (Ruff-style)
283
193
  [rules]
284
- include = ["buildkit/*", "tally/*"] # Enable rules by namespace or specific rule
285
- exclude = ["buildkit/MaintainerDeprecated"] # Disable specific rules
194
+ include = ["buildkit/*", "tally/*"]
195
+ exclude = ["buildkit/MaintainerDeprecated"]
286
196
 
287
- # Per-rule configuration (severity, options)
288
197
  [rules.tally.max-lines]
289
- severity = "error"
290
- max = 500
291
- skip-blank-lines = true
292
- skip-comments = true
293
-
294
- [rules.buildkit.StageNameCasing]
295
- severity = "info" # Downgrade severity
296
-
297
- [rules.hadolint.DL3026]
298
- severity = "warning"
299
- trusted-registries = ["docker.io", "gcr.io"]
198
+ max = 100
300
199
  ```
301
200
 
302
- ### Config File Discovery
303
-
304
- tally uses cascading config discovery similar to [Ruff](https://docs.astral.sh/ruff/configuration/):
305
-
306
- 1. Starting from the Dockerfile's directory, walks up the filesystem
307
- 2. Stops at the first `.tally.toml` or `tally.toml` found
308
- 3. Uses that config (no merging with parent configs)
309
-
310
- This allows monorepo setups with per-directory configurations.
311
-
312
- ### Priority Order
313
-
314
- Configuration sources are applied in this order (highest priority first):
315
-
316
- 1. **CLI flags** (`--max-lines 100`)
317
- 2. **Environment variables** (`TALLY_RULES_MAX_LINES_MAX=100`)
318
- 3. **Config file** (`.tally.toml` or `tally.toml`)
319
- 4. **Built-in defaults**
201
+ Configuration priority: CLI flags > environment variables > config file > defaults.
320
202
 
321
- ### Environment Variables
322
-
323
- | Variable | Description |
324
- | ---------------------------------------- | --------------------------------------------------------------------- |
325
- | `TALLY_OUTPUT_FORMAT` | Output format (`text`, `json`, `sarif`, `github-actions`, `markdown`) |
326
- | `TALLY_OUTPUT_PATH` | Output destination (`stdout`, `stderr`, or file path) |
327
- | `TALLY_OUTPUT_SHOW_SOURCE` | Show source snippets (`true`/`false`) |
328
- | `TALLY_OUTPUT_FAIL_LEVEL` | Minimum severity for non-zero exit |
329
- | `NO_COLOR` | Disable colored output (standard env var) |
330
- | `TALLY_EXCLUDE` | Glob pattern(s) to exclude files (comma-separated) |
331
- | `TALLY_CONTEXT` | Build context directory for context-aware rules |
332
- | `TALLY_RULES_MAX_LINES_MAX` | Maximum lines allowed |
333
- | `TALLY_RULES_MAX_LINES_SKIP_BLANK_LINES` | Exclude blank lines (`true`/`false`) |
334
- | `TALLY_RULES_MAX_LINES_SKIP_COMMENTS` | Exclude comments (`true`/`false`) |
335
- | `TALLY_NO_INLINE_DIRECTIVES` | Disable inline directive processing (`true`/`false`) |
336
- | `TALLY_INLINE_DIRECTIVES_WARN_UNUSED` | Warn about unused directives (`true`/`false`) |
337
- | `TALLY_INLINE_DIRECTIVES_REQUIRE_REASON` | Require reason= on ignore directives (`true`/`false`) |
338
-
339
- ### CLI Flags
340
-
341
- ```bash
342
- # Specify config file explicitly
343
- tally check --config /path/to/.tally.toml Dockerfile
344
-
345
- # Override max-lines from config
346
- tally check --max-lines 200 Dockerfile
347
-
348
- # Exclude blank lines and comments from count
349
- tally check --max-lines 100 --skip-blank-lines --skip-comments Dockerfile
350
- ```
203
+ **See [Configuration Guide](docs/guide/configuration.md) for full reference.**
351
204
 
352
205
  ## Output Formats
353
206
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tally-cli",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "A fast, configurable linter for Dockerfiles and Containerfiles",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,13 +31,13 @@
31
31
  "node": ">=18.0.0"
32
32
  },
33
33
  "optionalDependencies": {
34
- "@contino/tally-darwin-arm64": "0.6.0",
35
- "@contino/tally-darwin-x64": "0.6.0",
36
- "@contino/tally-linux-arm64": "0.6.0",
37
- "@contino/tally-linux-x64": "0.6.0",
38
- "@contino/tally-windows-arm64": "0.6.0",
39
- "@contino/tally-windows-x64": "0.6.0",
40
- "@contino/tally-freebsd-x64": "0.6.0"
34
+ "@contino/tally-darwin-arm64": "0.7.0",
35
+ "@contino/tally-darwin-x64": "0.7.0",
36
+ "@contino/tally-linux-arm64": "0.7.0",
37
+ "@contino/tally-linux-x64": "0.7.0",
38
+ "@contino/tally-windows-arm64": "0.7.0",
39
+ "@contino/tally-windows-x64": "0.7.0",
40
+ "@contino/tally-freebsd-x64": "0.7.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"