@standards-kit/conform 0.1.0 → 0.1.3

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 (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +143 -0
  3. package/dist/{chunk-P7TIZJ4C.js → chunk-DXIYZR62.js} +2 -2
  4. package/dist/chunk-DXIYZR62.js.map +1 -0
  5. package/dist/{chunk-KHO6NIAI.js → chunk-PZ2NVKI7.js} +7 -7
  6. package/dist/chunk-PZ2NVKI7.js.map +1 -0
  7. package/dist/cli.d.ts +2 -0
  8. package/dist/cli.js +14 -14
  9. package/dist/cli.js.map +1 -1
  10. package/dist/code/index.d.ts +11 -0
  11. package/dist/code/tools/base.d.ts +51 -0
  12. package/dist/code/tools/comment-utils.d.ts +17 -0
  13. package/dist/code/tools/coverage-run.d.ts +37 -0
  14. package/dist/code/tools/disable-comments.d.ts +42 -0
  15. package/dist/code/tools/eslint.d.ts +99 -0
  16. package/dist/code/tools/gitleaks.d.ts +42 -0
  17. package/dist/code/tools/index.d.ts +13 -0
  18. package/dist/code/tools/knip.d.ts +20 -0
  19. package/dist/code/tools/naming.d.ts +64 -0
  20. package/dist/code/tools/pipaudit.d.ts +24 -0
  21. package/dist/code/tools/pnpmaudit.d.ts +36 -0
  22. package/dist/code/tools/ruff.d.ts +46 -0
  23. package/dist/code/tools/tsc.d.ts +57 -0
  24. package/dist/code/tools/ty.d.ts +34 -0
  25. package/dist/code/tools/vulture.d.ts +32 -0
  26. package/dist/core/index.d.ts +7 -0
  27. package/dist/core/loader.d.ts +42 -0
  28. package/dist/core/registry.d.ts +17 -0
  29. package/dist/core/schema.d.ts +1829 -0
  30. package/dist/core/types.d.ts +95 -0
  31. package/dist/{src-KZRTG3EU.js → core-KB2W6SE2.js} +3 -3
  32. package/dist/dependencies/index.d.ts +13 -0
  33. package/dist/dependencies/mappings.d.ts +17 -0
  34. package/dist/dependencies/output.d.ts +12 -0
  35. package/dist/dependencies/types.d.ts +34 -0
  36. package/dist/index.d.ts +21 -0
  37. package/dist/index.js +9 -5
  38. package/dist/index.js.map +1 -1
  39. package/dist/infra/arn.d.ts +16 -0
  40. package/dist/infra/checkers/cloudwatch.d.ts +8 -0
  41. package/dist/infra/checkers/dynamodb.d.ts +8 -0
  42. package/dist/infra/checkers/ec2.d.ts +13 -0
  43. package/dist/infra/checkers/ecs.d.ts +13 -0
  44. package/dist/infra/checkers/elasticache.d.ts +13 -0
  45. package/dist/infra/checkers/elb.d.ts +13 -0
  46. package/dist/infra/checkers/gcp/artifactregistry.d.ts +5 -0
  47. package/dist/infra/checkers/gcp/cloudrun.d.ts +5 -0
  48. package/dist/infra/checkers/gcp/iam.d.ts +5 -0
  49. package/dist/infra/checkers/gcp/index.d.ts +17 -0
  50. package/dist/infra/checkers/gcp/secretmanager.d.ts +5 -0
  51. package/dist/infra/checkers/iam.d.ts +8 -0
  52. package/dist/infra/checkers/index.d.ts +26 -0
  53. package/dist/infra/checkers/lambda.d.ts +8 -0
  54. package/dist/infra/checkers/rds.d.ts +13 -0
  55. package/dist/infra/checkers/s3.d.ts +8 -0
  56. package/dist/infra/checkers/secretsmanager.d.ts +8 -0
  57. package/dist/infra/checkers/sns.d.ts +8 -0
  58. package/dist/infra/checkers/sqs.d.ts +8 -0
  59. package/dist/infra/checkers/types.d.ts +28 -0
  60. package/dist/infra/gcp.d.ts +18 -0
  61. package/dist/infra/generate.d.ts +74 -0
  62. package/dist/infra/index.d.ts +59 -0
  63. package/dist/infra/manifest.d.ts +58 -0
  64. package/dist/infra/output.d.ts +8 -0
  65. package/dist/infra/scan.d.ts +25 -0
  66. package/dist/infra/schemas.d.ts +806 -0
  67. package/dist/infra/types.d.ts +8 -0
  68. package/dist/{infra-UXM5XQX3.js → infra-ZQRXX7AW.js} +3 -3
  69. package/dist/infra-ZQRXX7AW.js.map +1 -0
  70. package/dist/mcp/index.d.ts +7 -0
  71. package/dist/mcp/server.d.ts +18 -0
  72. package/dist/mcp/standards/fetcher.d.ts +29 -0
  73. package/dist/mcp/standards/index.d.ts +4 -0
  74. package/dist/mcp/standards/matcher.d.ts +22 -0
  75. package/dist/mcp/standards/parser.d.ts +46 -0
  76. package/dist/mcp/standards/types.d.ts +32 -0
  77. package/dist/mcp/tools/get-guideline.d.ts +26 -0
  78. package/dist/mcp/tools/get-ruleset.d.ts +26 -0
  79. package/dist/mcp/tools/get-standards.d.ts +27 -0
  80. package/dist/mcp/tools/index.d.ts +4 -0
  81. package/dist/mcp/tools/list-guidelines.d.ts +25 -0
  82. package/dist/{mcp-O5O7XVFG.js → mcp-WXYRFNEV.js} +3 -3
  83. package/dist/mcp-WXYRFNEV.js.map +1 -0
  84. package/dist/output/index.d.ts +14 -0
  85. package/dist/process/commands/check-branch.d.ts +13 -0
  86. package/dist/process/commands/check-commit.d.ts +14 -0
  87. package/dist/process/commands/index.d.ts +2 -0
  88. package/dist/process/index.d.ts +11 -0
  89. package/dist/process/scan/index.d.ts +5 -0
  90. package/dist/process/scan/remote-fetcher.d.ts +18 -0
  91. package/dist/process/scan/scanner.d.ts +6 -0
  92. package/dist/process/scan/types.d.ts +57 -0
  93. package/dist/process/scan/validators.d.ts +37 -0
  94. package/dist/process/sync/applier.d.ts +10 -0
  95. package/dist/process/sync/differ.d.ts +7 -0
  96. package/dist/process/sync/fetcher.d.ts +14 -0
  97. package/dist/process/sync/index.d.ts +9 -0
  98. package/dist/process/sync/types.d.ts +131 -0
  99. package/dist/process/sync/validator.d.ts +22 -0
  100. package/dist/process/tools/backups.d.ts +32 -0
  101. package/dist/process/tools/base.d.ts +52 -0
  102. package/dist/process/tools/branches.d.ts +41 -0
  103. package/dist/process/tools/changesets.d.ts +53 -0
  104. package/dist/process/tools/ci.d.ts +57 -0
  105. package/dist/process/tools/codeowners.d.ts +68 -0
  106. package/dist/process/tools/commits.d.ts +39 -0
  107. package/dist/process/tools/coverage.d.ts +57 -0
  108. package/dist/process/tools/docs-helpers.d.ts +44 -0
  109. package/dist/process/tools/docs.d.ts +38 -0
  110. package/dist/process/tools/forbidden-files.d.ts +40 -0
  111. package/dist/process/tools/hooks.d.ts +39 -0
  112. package/dist/process/tools/index.d.ts +14 -0
  113. package/dist/process/tools/pr.d.ts +59 -0
  114. package/dist/process/tools/repo.d.ts +65 -0
  115. package/dist/process/tools/tickets.d.ts +42 -0
  116. package/dist/projects/detector.d.ts +16 -0
  117. package/dist/projects/index.d.ts +4 -0
  118. package/dist/projects/templates.d.ts +15 -0
  119. package/dist/projects/tier-loader.d.ts +14 -0
  120. package/dist/projects/types.d.ts +76 -0
  121. package/dist/{registry-V65CC7IN.js → registry-7CDIMOLZ.js} +2 -2
  122. package/dist/{scan-EELS42BP.js → scan-IKEHLZXV.js} +4 -4
  123. package/dist/{scan-EELS42BP.js.map → scan-IKEHLZXV.js.map} +1 -1
  124. package/dist/{sync-RLYBGYNY.js → sync-XV6XBLVZ.js} +3 -3
  125. package/dist/{sync-RLYBGYNY.js.map → sync-XV6XBLVZ.js.map} +1 -1
  126. package/dist/validate/guidelines.d.ts +18 -0
  127. package/dist/validate/index.d.ts +5 -0
  128. package/dist/validate/tier.d.ts +14 -0
  129. package/dist/validate/types.d.ts +56 -0
  130. package/dist/{validate-AABLVQJS.js → validate-DKEJICCK.js} +3 -3
  131. package/dist/validate-DKEJICCK.js.map +1 -0
  132. package/package.json +26 -19
  133. package/dist/chunk-KHO6NIAI.js.map +0 -1
  134. package/dist/chunk-P7TIZJ4C.js.map +0 -1
  135. package/dist/infra-UXM5XQX3.js.map +0 -1
  136. package/dist/mcp-O5O7XVFG.js.map +0 -1
  137. package/dist/validate-AABLVQJS.js.map +0 -1
  138. /package/dist/{registry-V65CC7IN.js.map → core-KB2W6SE2.js.map} +0 -0
  139. /package/dist/{src-KZRTG3EU.js.map → registry-7CDIMOLZ.js.map} +0 -0
@@ -0,0 +1,11 @@
1
+ import { type Config } from "../core/index.js";
2
+ import { type DomainResult } from "../core/index.js";
3
+ export { BaseToolRunner, ESLintRunner, KnipRunner, NamingRunner, RuffRunner, TscRunner, TyRunner, VultureRunner, } from "./tools/index.js";
4
+ /**
5
+ * Run all code checks based on configuration
6
+ */
7
+ export declare function runCodeChecks(projectRoot: string, config: Config): Promise<DomainResult>;
8
+ /**
9
+ * Audit code configuration (check that configs exist without running tools)
10
+ */
11
+ export declare function auditCodeConfig(projectRoot: string, config: Config): Promise<DomainResult>;
@@ -0,0 +1,51 @@
1
+ import { type CheckResult, type IToolRunner, type Violation } from "../../core/index.js";
2
+ /**
3
+ * Abstract base class for tool runners.
4
+ * Provides common functionality for checking configs and handling errors.
5
+ */
6
+ export declare abstract class BaseToolRunner implements IToolRunner {
7
+ abstract readonly name: string;
8
+ abstract readonly rule: string;
9
+ abstract readonly toolId: string;
10
+ abstract readonly configFiles: string[];
11
+ /**
12
+ * Check if any of the config files exist
13
+ */
14
+ protected hasConfig(projectRoot: string): boolean;
15
+ /**
16
+ * Find which config file exists (if any)
17
+ */
18
+ protected findConfig(projectRoot: string): string | null;
19
+ /**
20
+ * Check if an error indicates the tool is not installed
21
+ */
22
+ protected isNotInstalledError(error: unknown): boolean;
23
+ /**
24
+ * Create a fail result for when config is missing
25
+ */
26
+ protected failNoConfig(duration: number): CheckResult;
27
+ /**
28
+ * Create a skip result for when tool is not installed
29
+ */
30
+ protected skipNotInstalled(duration: number): CheckResult;
31
+ /**
32
+ * Create a pass result
33
+ */
34
+ protected pass(duration: number): CheckResult;
35
+ /**
36
+ * Create a fail result from violations
37
+ */
38
+ protected fail(violations: Violation[], duration: number): CheckResult;
39
+ /**
40
+ * Create a result from violations (pass if empty, fail otherwise)
41
+ */
42
+ protected fromViolations(violations: Violation[], duration: number): CheckResult;
43
+ /**
44
+ * Run the tool - must be implemented by subclasses
45
+ */
46
+ abstract run(projectRoot: string): Promise<CheckResult>;
47
+ /**
48
+ * Default audit implementation - checks if config exists
49
+ */
50
+ audit(projectRoot: string): Promise<CheckResult>;
51
+ }
@@ -0,0 +1,17 @@
1
+ /** File extensions with known comment syntax */
2
+ export declare const KNOWN_EXTENSIONS: Set<string>;
3
+ /**
4
+ * Find the first pattern that appears in the given text range.
5
+ */
6
+ export declare function findFirstPattern(text: string, patterns: string[]): string | null;
7
+ /**
8
+ * Find where a block comment ends in a line. Returns -1 if not found.
9
+ */
10
+ export declare function findBlockEnd(line: string, startIndex: number): number;
11
+ /**
12
+ * Find comment start in a line, respecting string boundaries.
13
+ */
14
+ export declare function findCommentInLine(line: string, startPos: number, isPython: boolean): {
15
+ index: number;
16
+ isBlock: boolean;
17
+ } | null;
@@ -0,0 +1,37 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /** Coverage run configuration from standards.toml */
4
+ interface CoverageRunConfig {
5
+ enabled?: boolean;
6
+ min_threshold?: number;
7
+ runner?: "vitest" | "jest" | "pytest" | "auto";
8
+ command?: string;
9
+ }
10
+ /**
11
+ * Coverage verification runner.
12
+ * Runs tests with coverage and verifies the result meets a minimum threshold.
13
+ */
14
+ export declare class CoverageRunRunner extends BaseToolRunner {
15
+ readonly name = "Coverage Run";
16
+ readonly rule = "code.coverage";
17
+ readonly toolId = "coverage-run";
18
+ readonly configFiles: string[];
19
+ private config;
20
+ setConfig(config: CoverageRunConfig): void;
21
+ private detectRunner;
22
+ private getRunnerCommand;
23
+ private getTestCommand;
24
+ private parseCoverageReport;
25
+ private extractCoverageData;
26
+ private computeCoverageFromFinal;
27
+ private getOverallCoverage;
28
+ private executeTests;
29
+ private checkCoverageThreshold;
30
+ run(projectRoot: string): Promise<CheckResult>;
31
+ /** Validate test command exit code and return error result if invalid */
32
+ private validateExitCode;
33
+ private handleRunError;
34
+ audit(projectRoot: string): Promise<CheckResult>;
35
+ private createViolation;
36
+ }
37
+ export {};
@@ -0,0 +1,42 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /** Configuration for disable-comments validation */
4
+ interface DisableCommentsConfig {
5
+ enabled?: boolean;
6
+ patterns?: string[];
7
+ extensions?: string[];
8
+ exclude?: string[];
9
+ }
10
+ /**
11
+ * Disable comments runner for detecting linter/type-checker disable comments
12
+ */
13
+ export declare class DisableCommentsRunner extends BaseToolRunner {
14
+ readonly name = "Disable Comments";
15
+ readonly rule = "code.quality";
16
+ readonly toolId = "disable-comments";
17
+ readonly configFiles: string[];
18
+ private config;
19
+ setConfig(config: DisableCommentsConfig): void;
20
+ private getPatterns;
21
+ private getExtensions;
22
+ private getExcludePatterns;
23
+ private buildGlobPattern;
24
+ run(projectRoot: string): Promise<CheckResult>;
25
+ private scanAllFiles;
26
+ private scanFile;
27
+ private scanContent;
28
+ private scanLine;
29
+ private scanSimpleLine;
30
+ private scanJsLine;
31
+ private processJsLineComments;
32
+ private handleInsideBlock;
33
+ private handleOutsideBlock;
34
+ private handleLineComment;
35
+ private handleBlockCommentStart;
36
+ /** Check if a pattern appears in a comment (not in a string) - for simple line detection */
37
+ private isPatternInComment;
38
+ private createViolation;
39
+ private createErrorViolation;
40
+ audit(_projectRoot: string): Promise<CheckResult>;
41
+ }
42
+ export {};
@@ -0,0 +1,99 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /**
4
+ * ESLint rule with options in TOML-friendly object format.
5
+ * Example: { severity: "error", max: 10 }
6
+ */
7
+ interface ESLintRuleWithOptions {
8
+ severity: "off" | "warn" | "error";
9
+ [key: string]: unknown;
10
+ }
11
+ /** ESLint rule value - severity string or object with options */
12
+ type ESLintRuleValue = "off" | "warn" | "error" | ESLintRuleWithOptions;
13
+ /** ESLint configuration options */
14
+ interface ESLintConfig {
15
+ enabled?: boolean;
16
+ files?: string[];
17
+ ignore?: string[];
18
+ "max-warnings"?: number;
19
+ rules?: Record<string, ESLintRuleValue>;
20
+ }
21
+ /**
22
+ * ESLint tool runner
23
+ */
24
+ export declare class ESLintRunner extends BaseToolRunner {
25
+ readonly name = "ESLint";
26
+ readonly rule = "code.linting";
27
+ readonly toolId = "eslint";
28
+ readonly configFiles: string[];
29
+ private config;
30
+ /**
31
+ * Set ESLint configuration options
32
+ */
33
+ setConfig(config: ESLintConfig): void;
34
+ run(projectRoot: string): Promise<CheckResult>;
35
+ /**
36
+ * Audit ESLint config - verify config exists and required rules are present
37
+ */
38
+ audit(projectRoot: string): Promise<CheckResult>;
39
+ /**
40
+ * Audit that required rules are present in ESLint config
41
+ */
42
+ private auditRules;
43
+ /**
44
+ * Get effective ESLint rules for a file
45
+ */
46
+ private getEffectiveRules;
47
+ /**
48
+ * Extract options from a rule value (excludes severity)
49
+ */
50
+ private extractRuleOptions;
51
+ /**
52
+ * Get effective option value, handling both object and primitive formats.
53
+ * ESLint normalizes some rules like max-depth from ["error", { max: 4 }] to [2, 4].
54
+ */
55
+ private getEffectiveOptionValue;
56
+ /**
57
+ * Compare rule options between required and effective config.
58
+ */
59
+ private compareRuleOptions;
60
+ /** Compare single-object rule options for detailed error messages */
61
+ private compareObjectOptions;
62
+ /**
63
+ * Deep equality check for comparing option values
64
+ */
65
+ private deepEqual;
66
+ /**
67
+ * Compare a single rule against effective config
68
+ */
69
+ private compareSingleRule;
70
+ /**
71
+ * Compare required rules against effective rules
72
+ */
73
+ private compareRules;
74
+ /**
75
+ * Create an audit violation
76
+ */
77
+ private createAuditViolation;
78
+ /**
79
+ * Find a sample source file to check ESLint config against.
80
+ * Requires 'files' to be configured in standards.toml.
81
+ */
82
+ private findSampleFile;
83
+ /**
84
+ * Check if a value is an ESLint rule with options object
85
+ */
86
+ private isRuleWithOptions;
87
+ /**
88
+ * Normalize rule severity to number (0, 1, 2)
89
+ */
90
+ private normalizeSeverity;
91
+ /**
92
+ * Convert severity number to string
93
+ */
94
+ private severityToString;
95
+ private buildArgs;
96
+ private parseOutput;
97
+ private createErrorViolation;
98
+ }
99
+ export {};
@@ -0,0 +1,42 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /** Scan mode options */
4
+ type ScanMode = "branch" | "files" | "staged" | "full";
5
+ /** Gitleaks configuration */
6
+ interface GitleaksConfig {
7
+ enabled?: boolean;
8
+ scan_mode?: ScanMode;
9
+ base_branch?: string;
10
+ }
11
+ /**
12
+ * Gitleaks tool runner for detecting hardcoded secrets
13
+ */
14
+ export declare class GitleaksRunner extends BaseToolRunner {
15
+ readonly name = "gitleaks";
16
+ readonly rule = "code.security";
17
+ readonly toolId = "secrets";
18
+ readonly configFiles: string[];
19
+ private config;
20
+ setConfig(config: GitleaksConfig): void;
21
+ /**
22
+ * Find gitleaks config file if it exists
23
+ * Returns just the filename (relative to projectRoot) since gitleaks runs with cwd=projectRoot
24
+ */
25
+ private findGitleaksConfig;
26
+ /**
27
+ * Build gitleaks arguments based on scan mode
28
+ */
29
+ private buildArgs;
30
+ run(projectRoot: string): Promise<CheckResult>;
31
+ private isBinaryNotFound;
32
+ private processResult;
33
+ private processLeaksFound;
34
+ private handleRunError;
35
+ private parseOutput;
36
+ private createErrorViolation;
37
+ /**
38
+ * Audit - gitleaks doesn't require config, just check if installed
39
+ */
40
+ audit(projectRoot: string): Promise<CheckResult>;
41
+ }
42
+ export {};
@@ -0,0 +1,13 @@
1
+ export { BaseToolRunner } from "./base.js";
2
+ export { CoverageRunRunner } from "./coverage-run.js";
3
+ export { DisableCommentsRunner } from "./disable-comments.js";
4
+ export { ESLintRunner } from "./eslint.js";
5
+ export { GitleaksRunner } from "./gitleaks.js";
6
+ export { KnipRunner } from "./knip.js";
7
+ export { NamingRunner } from "./naming.js";
8
+ export { PipAuditRunner } from "./pipaudit.js";
9
+ export { PnpmAuditRunner } from "./pnpmaudit.js";
10
+ export { RuffRunner } from "./ruff.js";
11
+ export { TscRunner } from "./tsc.js";
12
+ export { TyRunner } from "./ty.js";
13
+ export { VultureRunner } from "./vulture.js";
@@ -0,0 +1,20 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /**
4
+ * Knip tool runner for detecting unused code
5
+ */
6
+ export declare class KnipRunner extends BaseToolRunner {
7
+ readonly name = "Knip";
8
+ readonly rule = "code.unused";
9
+ readonly toolId = "knip";
10
+ readonly configFiles: string[];
11
+ run(projectRoot: string): Promise<CheckResult>;
12
+ private parseOutput;
13
+ private parseFileIssues;
14
+ private mapToViolations;
15
+ private createErrorViolation;
16
+ /**
17
+ * Audit - Knip doesn't require a config file, so just check if it can run
18
+ */
19
+ audit(projectRoot: string): Promise<CheckResult>;
20
+ }
@@ -0,0 +1,64 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /** Supported case types */
4
+ type CaseType = "kebab-case" | "snake_case" | "camelCase" | "PascalCase";
5
+ /** Single naming rule configuration */
6
+ interface NamingRule {
7
+ extensions: string[];
8
+ file_case: CaseType;
9
+ folder_case: CaseType;
10
+ exclude?: string[];
11
+ allow_dynamic_routes?: boolean;
12
+ }
13
+ /** Configuration for naming validation */
14
+ interface NamingConfig {
15
+ enabled?: boolean;
16
+ rules?: NamingRule[];
17
+ }
18
+ /**
19
+ * Naming conventions runner for checking file and folder names
20
+ */
21
+ export declare class NamingRunner extends BaseToolRunner {
22
+ readonly name = "Naming";
23
+ readonly rule = "code.naming";
24
+ readonly toolId = "naming";
25
+ readonly configFiles: string[];
26
+ private config;
27
+ /**
28
+ * Set the configuration for this runner
29
+ */
30
+ setConfig(config: NamingConfig): void;
31
+ run(projectRoot: string): Promise<CheckResult>;
32
+ /**
33
+ * Check a single naming rule against the project
34
+ */
35
+ private checkRule;
36
+ /**
37
+ * Check file names and collect folders containing matching files
38
+ */
39
+ private checkFiles;
40
+ /**
41
+ * Check folder names for all folders containing matching files
42
+ */
43
+ private checkFolders;
44
+ /**
45
+ * Get the name to validate from a folder segment, handling dynamic routes
46
+ */
47
+ private getNameToValidate;
48
+ /**
49
+ * Check all segments of a folder path
50
+ */
51
+ private checkFolderPath;
52
+ /**
53
+ * Build a glob pattern for the given extensions
54
+ */
55
+ private buildGlobPattern;
56
+ private createFileViolation;
57
+ private createFolderViolation;
58
+ private createErrorViolation;
59
+ /**
60
+ * Audit - for naming, we just verify the config is valid
61
+ */
62
+ audit(_projectRoot: string): Promise<CheckResult>;
63
+ }
64
+ export {};
@@ -0,0 +1,24 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /**
4
+ * pip-audit tool runner for detecting Python dependency vulnerabilities
5
+ */
6
+ export declare class PipAuditRunner extends BaseToolRunner {
7
+ readonly name = "pipaudit";
8
+ readonly rule = "code.security";
9
+ readonly toolId = "pipaudit";
10
+ readonly configFiles: string[];
11
+ run(projectRoot: string): Promise<CheckResult>;
12
+ private processResult;
13
+ private runPipAudit;
14
+ private parseOutput;
15
+ private mapSeverity;
16
+ private getFixInfo;
17
+ private projectRoot;
18
+ private findDependencyFile;
19
+ private createErrorViolation;
20
+ /**
21
+ * Audit - check if Python dependency files exist
22
+ */
23
+ audit(projectRoot: string): Promise<CheckResult>;
24
+ }
@@ -0,0 +1,36 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /** pnpm audit configuration */
4
+ export interface PnpmAuditConfig {
5
+ enabled?: boolean;
6
+ exclude_dev?: boolean;
7
+ }
8
+ /**
9
+ * pnpm dependency audit tool runner for detecting vulnerabilities.
10
+ * Only checks production dependencies by default (exclude_dev: true).
11
+ */
12
+ export declare class PnpmAuditRunner extends BaseToolRunner {
13
+ readonly name = "pnpmaudit";
14
+ readonly rule = "code.security";
15
+ readonly toolId = "pnpmaudit";
16
+ readonly configFiles: string[];
17
+ private config;
18
+ /**
19
+ * Set configuration for the runner
20
+ */
21
+ setConfig(config: PnpmAuditConfig): void;
22
+ /**
23
+ * Check if pnpm-lock.yaml exists
24
+ */
25
+ private hasLockFile;
26
+ run(projectRoot: string): Promise<CheckResult>;
27
+ private processAuditResult;
28
+ private handleRunError;
29
+ private parseOutput;
30
+ private mapSeverity;
31
+ private createErrorViolation;
32
+ /**
33
+ * Audit - check if pnpm-lock.yaml exists
34
+ */
35
+ audit(projectRoot: string): Promise<CheckResult>;
36
+ }
@@ -0,0 +1,46 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /** Ruff configuration options from standards.toml */
4
+ interface RuffConfig {
5
+ enabled?: boolean;
6
+ format?: boolean;
7
+ "line-length"?: number;
8
+ lint?: {
9
+ select?: string[];
10
+ ignore?: string[];
11
+ };
12
+ }
13
+ /**
14
+ * Ruff (Python linter) tool runner
15
+ */
16
+ export declare class RuffRunner extends BaseToolRunner {
17
+ readonly name = "Ruff";
18
+ readonly rule = "code.linting";
19
+ readonly toolId = "ruff";
20
+ readonly configFiles: string[];
21
+ private ruffConfig;
22
+ /**
23
+ * Set the Ruff configuration from standards.toml
24
+ */
25
+ setConfig(config: RuffConfig): void;
26
+ /**
27
+ * Build CLI arguments from config
28
+ */
29
+ private buildCliArgs;
30
+ /**
31
+ * Override hasConfig to also check for [tool.ruff] in pyproject.toml
32
+ */
33
+ protected hasConfig(projectRoot: string): boolean;
34
+ private hasPyprojectConfig;
35
+ private hasPythonFiles;
36
+ private isBinaryNotFound;
37
+ run(projectRoot: string): Promise<CheckResult>;
38
+ private skip;
39
+ private parseOutput;
40
+ private createErrorViolation;
41
+ /**
42
+ * Override audit to include pyproject.toml check
43
+ */
44
+ audit(projectRoot: string): Promise<CheckResult>;
45
+ }
46
+ export {};
@@ -0,0 +1,57 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /** TypeScript compiler options that can be audited */
4
+ interface TscRequiredOptions {
5
+ strict?: boolean;
6
+ noImplicitAny?: boolean;
7
+ strictNullChecks?: boolean;
8
+ noUnusedLocals?: boolean;
9
+ noUnusedParameters?: boolean;
10
+ noImplicitReturns?: boolean;
11
+ noFallthroughCasesInSwitch?: boolean;
12
+ esModuleInterop?: boolean;
13
+ skipLibCheck?: boolean;
14
+ forceConsistentCasingInFileNames?: boolean;
15
+ }
16
+ /**
17
+ * TypeScript type checker tool runner
18
+ */
19
+ export declare class TscRunner extends BaseToolRunner {
20
+ readonly name = "TypeScript";
21
+ readonly rule = "code.types";
22
+ readonly toolId = "tsc";
23
+ readonly configFiles: string[];
24
+ private requiredOptions;
25
+ /**
26
+ * Set required compiler options for audit
27
+ */
28
+ setRequiredOptions(options: TscRequiredOptions): void;
29
+ /**
30
+ * Strip ANSI escape codes from a string
31
+ */
32
+ private stripAnsi;
33
+ /**
34
+ * Check if the output indicates tsc is not installed
35
+ */
36
+ private isTscNotFoundOutput;
37
+ private handleTscFailure;
38
+ private runTsc;
39
+ private processRunResult;
40
+ run(projectRoot: string): Promise<CheckResult>;
41
+ /**
42
+ * Parse tsc output into diagnostics
43
+ * Format: file(line,col): error TSxxxx: message
44
+ */
45
+ private parseOutput;
46
+ private parseDiagnostics;
47
+ private createErrorViolation;
48
+ /**
49
+ * Audit tsconfig.json - check existence and required compiler options
50
+ */
51
+ audit(projectRoot: string): Promise<CheckResult>;
52
+ private parseConfigFile;
53
+ private auditCompilerOptions;
54
+ private validateCompilerOptions;
55
+ private createAuditViolation;
56
+ }
57
+ export {};
@@ -0,0 +1,34 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /**
4
+ * ty Python type checker tool runner
5
+ * ty is Astral's extremely fast Python type checker
6
+ */
7
+ export declare class TyRunner extends BaseToolRunner {
8
+ readonly name = "ty";
9
+ readonly rule = "code.types";
10
+ readonly toolId = "ty";
11
+ readonly configFiles: string[];
12
+ /**
13
+ * Override hasConfig to also check for [tool.ty] in pyproject.toml
14
+ */
15
+ protected hasConfig(projectRoot: string): boolean;
16
+ private hasPyprojectConfig;
17
+ /**
18
+ * Override audit to check for ty.toml or [tool.ty] in pyproject.toml
19
+ */
20
+ audit(projectRoot: string): Promise<CheckResult>;
21
+ run(projectRoot: string): Promise<CheckResult>;
22
+ private isBinaryNotFound;
23
+ private handleExitCode;
24
+ private handleTypeErrors;
25
+ private handleUnexpectedFailure;
26
+ /**
27
+ * Parse ty concise output into violations
28
+ * Format: file:line:column: severity[rule-code] message
29
+ * Example: test.py:4:15: error[invalid-assignment] Object of type `int` is not assignable to `str`
30
+ */
31
+ private parseOutput;
32
+ private parseDiagnostics;
33
+ private createErrorViolation;
34
+ }
@@ -0,0 +1,32 @@
1
+ import { type CheckResult } from "../../core/index.js";
2
+ import { BaseToolRunner } from "./base.js";
3
+ /**
4
+ * Vulture tool runner for detecting dead Python code
5
+ */
6
+ export declare class VultureRunner extends BaseToolRunner {
7
+ readonly name = "Vulture";
8
+ readonly rule = "code.unused";
9
+ readonly toolId = "vulture";
10
+ readonly configFiles: string[];
11
+ private hasPythonFiles;
12
+ private isBinaryNotFound;
13
+ run(projectRoot: string): Promise<CheckResult>;
14
+ private handleRunError;
15
+ private skip;
16
+ private parseOutput;
17
+ /**
18
+ * Parse a single Vulture output line
19
+ * Format: "path/to/file.py:10: unused function 'my_func' (60% confidence)"
20
+ */
21
+ private parseLine;
22
+ private static readonly CODE_PATTERNS;
23
+ /**
24
+ * Extract a code identifier from the vulture message
25
+ */
26
+ private getCodeFromMessage;
27
+ private createErrorViolation;
28
+ /**
29
+ * Audit - Vulture doesn't require a config file, so just check if Python files exist
30
+ */
31
+ audit(projectRoot: string): Promise<CheckResult>;
32
+ }
@@ -0,0 +1,7 @@
1
+ export type { Severity, DomainStatus, Violation, CheckResult, DomainResult, FullResult, IToolRunner, ViolationOptions, ExitCodeType, } from "./types.js";
2
+ export { ViolationBuilder, CheckResultBuilder, DomainResultBuilder, ExitCode, } from "./types.js";
3
+ export type { Config } from "./schema.js";
4
+ export { configSchema, defaultConfig, DEFAULT_FORBIDDEN_FILES_IGNORE } from "./schema.js";
5
+ export { CONFIG_FILE_NAME, ConfigError, findConfigFile, loadConfig, loadConfigAsync, loadConfigWithOverrides, getProjectRoot, } from "./loader.js";
6
+ export type { ConfigOverride } from "./loader.js";
7
+ export { parseRegistryUrl, fetchRegistry, loadRuleset, mergeConfigs, resolveExtends, } from "./registry.js";