@codacy/verity-cli 0.31.4 → 0.32.0-experimental.cc76941
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/CHANGELOG.md +182 -0
- package/README.md +50 -5
- package/bin/verity.js +2342 -595
- package/data/skills/verity-setup/SKILL.md +24 -1
- package/data/skills/verity-setup/patterns-reference.yaml +79 -54
- package/package.json +1 -1
|
@@ -18,7 +18,18 @@ So: **do not re-ask what init asked, and do not re-write what init wrote.** Wiri
|
|
|
18
18
|
hooks or a `.gitignore` block here is how the two flows drifted apart before — the
|
|
19
19
|
skill reconciled hooks init had just installed, silently removing them.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
⚠ **`verity init` NOW DERIVES THE STANDARD BY ITSELF**, so in most projects there
|
|
22
|
+
is nothing here left to do — the languages, the tool selection, the curated
|
|
23
|
+
pattern ids and `VERITY.md` are all lookups over this same catalogue, and the CLI
|
|
24
|
+
does them in about two seconds (`verity standard synthesize`). Step 1 will tell
|
|
25
|
+
you when that has already happened.
|
|
26
|
+
|
|
27
|
+
**You are here for the part a lookup cannot produce:** project-specific patterns —
|
|
28
|
+
"every route under `api/` uses the auth middleware", "RLS policies on all Supabase
|
|
29
|
+
tables". `custom_patterns` is left EMPTY by the CLI precisely so a model can
|
|
30
|
+
propose them from evidence rather than have them invented from a dependency list.
|
|
31
|
+
|
|
32
|
+
**What is yours when there is no Standard at all** (Step 1 says so, or `--force`):
|
|
22
33
|
1. Read the codebase and understand it (Step 2).
|
|
23
34
|
2. Synthesize `.verity/standard.yaml` from what you found (Step 4).
|
|
24
35
|
3. Write `.codacy/codacy.config.json` with curated, validated pattern ids (Step 5).
|
|
@@ -53,6 +64,18 @@ answers, the hook wiring, and a `next` list. Branch on it:
|
|
|
53
64
|
to launch a second Claude Code session on top of this one.
|
|
54
65
|
- **`blocked` is true** → a required prerequisite is missing. Show the
|
|
55
66
|
`prerequisites[].remedy` lines and stop; nothing below can work.
|
|
67
|
+
- **`artifacts.standard` is true and `phases.setup.done` is true** → the
|
|
68
|
+
project already has a Standard, derived or adopted. Your job is the part the CLI
|
|
69
|
+
leaves empty: propose 2–5 `custom_patterns` from the codebase, show them, and on
|
|
70
|
+
the user's agreement add them to `.verity/standard.yaml` and run
|
|
71
|
+
`verity standard push`. Do NOT rewrite the rest of the Standard — `standard push`
|
|
72
|
+
auto-versions, so a full re-synthesis lands as the version everybody is then
|
|
73
|
+
held to.
|
|
74
|
+
- **`artifacts.standard` is true but `artifacts.analysisConfig` is false** → the
|
|
75
|
+
CLI derives this case too: `verity standard synthesize --config-only` rewrites
|
|
76
|
+
the config from the Standard already in place. Prefer that over doing it by hand.
|
|
77
|
+
⚠ Do NOT suggest `--force` here — it REPLACES the Standard, and the team already
|
|
78
|
+
agreed that one. If you do it by hand, **Step 5 only**, then `verity config push`.
|
|
56
79
|
- **`artifacts.verityMd` is true and the user did not pass `--force`** → already
|
|
57
80
|
configured. Say "Already configured. Run `/verity-setup --force` to
|
|
58
81
|
reconfigure." and stop.
|
|
@@ -505,29 +505,29 @@ curated_patterns:
|
|
|
505
505
|
description: "Python errors + security. Skips style/formatting (use formatter instead)."
|
|
506
506
|
patterns:
|
|
507
507
|
# Pyflakes — error-prone
|
|
508
|
-
- patternId: "
|
|
509
|
-
- patternId: "
|
|
510
|
-
- patternId: "
|
|
511
|
-
- patternId: "
|
|
508
|
+
- patternId: "Ruff_F401_unused-import" # unused import
|
|
509
|
+
- patternId: "Ruff_F811_redefined-while-unused" # redefined unused name
|
|
510
|
+
- patternId: "Ruff_F841_unused-variable" # unused variable
|
|
511
|
+
- patternId: "Ruff_F821_undefined-name" # undefined name
|
|
512
512
|
# Bugbear — likely bugs
|
|
513
|
-
- patternId: "
|
|
514
|
-
- patternId: "
|
|
515
|
-
- patternId: "
|
|
513
|
+
- patternId: "Ruff_B006_mutable-argument-default" # mutable default argument
|
|
514
|
+
- patternId: "Ruff_B007_unused-loop-control-variable" # unused loop variable
|
|
515
|
+
- patternId: "Ruff_B018_useless-expression" # useless expression
|
|
516
516
|
# Security
|
|
517
|
-
- patternId: "
|
|
518
|
-
- patternId: "
|
|
519
|
-
- patternId: "
|
|
520
|
-
- patternId: "
|
|
521
|
-
- patternId: "
|
|
522
|
-
- patternId: "
|
|
523
|
-
- patternId: "
|
|
524
|
-
- patternId: "
|
|
525
|
-
- patternId: "
|
|
526
|
-
- patternId: "
|
|
527
|
-
- patternId: "
|
|
517
|
+
- patternId: "Ruff_S101_assert" # assert used (not for prod)
|
|
518
|
+
- patternId: "Ruff_S102_exec-builtin" # exec used
|
|
519
|
+
- patternId: "Ruff_S103_bad-file-permissions" # bad file permissions
|
|
520
|
+
- patternId: "Ruff_S104_hardcoded-bind-all-interfaces" # hardcoded bind all interfaces
|
|
521
|
+
- patternId: "Ruff_S105_hardcoded-password-string" # hardcoded password string
|
|
522
|
+
- patternId: "Ruff_S106_hardcoded-password-func-arg" # hardcoded password argument
|
|
523
|
+
- patternId: "Ruff_S107_hardcoded-password-default" # hardcoded password default
|
|
524
|
+
- patternId: "Ruff_S108_hardcoded-temp-file" # hardcoded temp file
|
|
525
|
+
- patternId: "Ruff_S110_try-except-pass" # try-except-pass
|
|
526
|
+
- patternId: "Ruff_S301_suspicious-pickle-usage" # pickle usage
|
|
527
|
+
- patternId: "Ruff_S608_hardcoded-sql-expression" # SQL injection via string formatting
|
|
528
528
|
# Type annotations (if desired)
|
|
529
|
-
- patternId: "
|
|
530
|
-
- patternId: "
|
|
529
|
+
- patternId: "Ruff_ANN001_missing-type-function-argument" # missing type annotation for function argument
|
|
530
|
+
- patternId: "Ruff_ANN201_missing-return-type-undocumented-public-function" # missing return type annotation
|
|
531
531
|
|
|
532
532
|
# --- ShellCheck (491 available → ~15 high-signal) ---
|
|
533
533
|
shellcheck:
|
|
@@ -552,34 +552,59 @@ curated_patterns:
|
|
|
552
552
|
Bandit:
|
|
553
553
|
description: "Python security only."
|
|
554
554
|
patterns:
|
|
555
|
-
- patternId: "
|
|
556
|
-
- patternId: "
|
|
557
|
-
- patternId: "
|
|
558
|
-
- patternId: "
|
|
559
|
-
- patternId: "
|
|
560
|
-
- patternId: "
|
|
561
|
-
- patternId: "
|
|
562
|
-
- patternId: "
|
|
563
|
-
- patternId: "
|
|
564
|
-
- patternId: "
|
|
565
|
-
|
|
566
|
-
# --- PMD7
|
|
555
|
+
- patternId: "Bandit_B101" # assert used
|
|
556
|
+
- patternId: "Bandit_B102" # exec used
|
|
557
|
+
- patternId: "Bandit_B103" # set_bad_file_permissions
|
|
558
|
+
- patternId: "Bandit_B104" # hardcoded_bind_all_interfaces
|
|
559
|
+
- patternId: "Bandit_B105" # hardcoded_password_string
|
|
560
|
+
- patternId: "Bandit_B301" # pickle usage
|
|
561
|
+
- patternId: "Bandit_B303" # insecure hash (md5/sha1)
|
|
562
|
+
- patternId: "Bandit_B608" # SQL injection
|
|
563
|
+
- patternId: "Bandit_B602" # subprocess with shell=True
|
|
564
|
+
- patternId: "Bandit_B501" # request with verify=False
|
|
565
|
+
|
|
566
|
+
# --- PMD7 — ⚠ LIST NOT DERIVED. THE TOOL IS DISABLED UNTIL IT IS. ---
|
|
567
|
+
#
|
|
568
|
+
# Audited 2026-09-07 against the installed adapter: all 12 ids below matched
|
|
569
|
+
# nothing. They are bare rule names, and the adapter's are category-qualified:
|
|
570
|
+
# UnusedLocalVariable → PMD7_category_java_bestpractices_UnusedLocalVariable
|
|
571
|
+
#
|
|
572
|
+
# ⚠ THE LIST IS EMPTY ON PURPOSE, AND EMPTYING IT IS WHAT DISABLES THE TOOL.
|
|
573
|
+
# `patterns: []` in the CATALOGUE means "no derived ids", which makes the CLI
|
|
574
|
+
# drop PMD7 (selectTools) — the same treatment Semgrep gets. Leaving the bare
|
|
575
|
+
# names here was worse than useless: on a machine with no adapter there is no
|
|
576
|
+
# intersection to filter them, so they were written into codacy.config.json and
|
|
577
|
+
# PMD7 ran with nothing enabled, reporting zero issues. That is the VRT-105
|
|
578
|
+
# failure, produced by the very list that documents it.
|
|
579
|
+
#
|
|
580
|
+
# They cannot be resolved mechanically: the suffix is AMBIGUOUS across
|
|
581
|
+
# languages — `UnusedLocalVariable` exists as both
|
|
582
|
+
# `PMD7_category_apex_bestpractices_…` and `PMD7_category_java_…` — so picking
|
|
583
|
+
# one would enable a rule that can never fire. Deriving them needs a human to
|
|
584
|
+
# choose the category per rule:
|
|
585
|
+
# node validate-patterns.mjs --list PMD7 '_category_java_'
|
|
586
|
+
#
|
|
587
|
+
# The curation to restore, once the categories are chosen:
|
|
588
|
+
# UnusedLocalVariable
|
|
589
|
+
# UnusedPrivateField
|
|
590
|
+
# UnusedPrivateMethod
|
|
591
|
+
# EmptyCatchBlock
|
|
592
|
+
# AvoidReassigningParameters
|
|
593
|
+
# CloseResource
|
|
594
|
+
# CompareObjectsWithEquals
|
|
595
|
+
# EqualsNull
|
|
596
|
+
# MissingBreakInSwitch
|
|
597
|
+
# NullAssignment
|
|
598
|
+
# ReturnEmptyCollectionRatherThanNull
|
|
599
|
+
# SimplifiedTernary
|
|
567
600
|
PMD7:
|
|
568
|
-
description: "Java error-prone
|
|
569
|
-
patterns:
|
|
570
|
-
- patternId: "UnusedLocalVariable"
|
|
571
|
-
- patternId: "UnusedPrivateField"
|
|
572
|
-
- patternId: "UnusedPrivateMethod"
|
|
573
|
-
- patternId: "EmptyCatchBlock"
|
|
574
|
-
- patternId: "AvoidReassigningParameters"
|
|
575
|
-
- patternId: "CloseResource"
|
|
576
|
-
- patternId: "CompareObjectsWithEquals"
|
|
577
|
-
- patternId: "EqualsNull"
|
|
578
|
-
- patternId: "MissingBreakInSwitch"
|
|
579
|
-
- patternId: "NullAssignment"
|
|
580
|
-
- patternId: "ReturnEmptyCollectionRatherThanNull"
|
|
581
|
-
- patternId: "SimplifiedTernary"
|
|
601
|
+
description: "Java quality + error-prone. NOT DERIVED — see above."
|
|
602
|
+
patterns: []
|
|
582
603
|
|
|
604
|
+
# --- detekt — ⚠ UNVERIFIED: no detekt adapter was installed when the other
|
|
605
|
+
# lists were audited (2026-09-07), so these ids have never been checked
|
|
606
|
+
# against one. The CLI drops any id the adapter does not define, so a wrong
|
|
607
|
+
# one costs the rule rather than the tool — but the list is not evidence.
|
|
583
608
|
# --- detekt (296 available → ~10 high-signal) ---
|
|
584
609
|
detekt:
|
|
585
610
|
description: "Kotlin error-prone + complexity."
|
|
@@ -604,11 +629,11 @@ curated_patterns:
|
|
|
604
629
|
Hadolint:
|
|
605
630
|
description: "Dockerfile best practices."
|
|
606
631
|
patterns:
|
|
607
|
-
- patternId: "
|
|
608
|
-
- patternId: "
|
|
609
|
-
- patternId: "
|
|
610
|
-
- patternId: "
|
|
611
|
-
- patternId: "
|
|
612
|
-
- patternId: "
|
|
613
|
-
- patternId: "
|
|
614
|
-
- patternId: "
|
|
632
|
+
- patternId: "Hadolint_DL3006" # always tag the version of an image
|
|
633
|
+
- patternId: "Hadolint_DL3007" # using latest is error-prone
|
|
634
|
+
- patternId: "Hadolint_DL3008" # pin versions in apt-get
|
|
635
|
+
- patternId: "Hadolint_DL3009" # delete apt-get lists
|
|
636
|
+
- patternId: "Hadolint_DL3018" # pin versions in apk add
|
|
637
|
+
- patternId: "Hadolint_DL3025" # use JSON for CMD
|
|
638
|
+
- patternId: "Hadolint_DL3028" # pin versions in gem install
|
|
639
|
+
- patternId: "Hadolint_DL4006" # set SHELL option -o pipefail
|