flowlint 0.1.3 → 0.3.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.
- package/package.json +26 -32
- package/README.md +0 -45
- package/dist/apps/cli/src/cli.d.ts +0 -8
- package/dist/apps/cli/src/cli.js +0 -27
- package/dist/apps/cli/src/cli.js.map +0 -1
- package/dist/apps/cli/src/commands/init.d.ts +0 -8
- package/dist/apps/cli/src/commands/init.js +0 -34
- package/dist/apps/cli/src/commands/init.js.map +0 -1
- package/dist/apps/cli/src/commands/scan.d.ts +0 -11
- package/dist/apps/cli/src/commands/scan.js +0 -59
- package/dist/apps/cli/src/commands/scan.js.map +0 -1
- package/dist/apps/cli/src/providers/local-config-provider.d.ts +0 -11
- package/dist/apps/cli/src/providers/local-config-provider.js +0 -39
- package/dist/apps/cli/src/providers/local-config-provider.js.map +0 -1
- package/dist/apps/cli/src/providers/local-file-source.d.ts +0 -13
- package/dist/apps/cli/src/providers/local-file-source.js +0 -47
- package/dist/apps/cli/src/providers/local-file-source.js.map +0 -1
- package/dist/apps/cli/src/reporters/console-reporter.d.ts +0 -8
- package/dist/apps/cli/src/reporters/console-reporter.js +0 -72
- package/dist/apps/cli/src/reporters/console-reporter.js.map +0 -1
- package/dist/apps/cli/src/reporters/json-reporter.d.ts +0 -14
- package/dist/apps/cli/src/reporters/json-reporter.js +0 -57
- package/dist/apps/cli/src/reporters/json-reporter.js.map +0 -1
- package/dist/packages/config/flowlint-config.d.ts +0 -64
- package/dist/packages/config/flowlint-config.js +0 -103
- package/dist/packages/config/flowlint-config.js.map +0 -1
- package/dist/packages/config/index.d.ts +0 -4
- package/dist/packages/config/index.js +0 -21
- package/dist/packages/config/index.js.map +0 -1
- package/dist/packages/github/client.d.ts +0 -2
- package/dist/packages/github/client.js +0 -94
- package/dist/packages/github/client.js.map +0 -1
- package/dist/packages/logger/index.d.ts +0 -11
- package/dist/packages/logger/index.js +0 -40
- package/dist/packages/logger/index.js.map +0 -1
- package/dist/packages/observability/collectors.d.ts +0 -40
- package/dist/packages/observability/collectors.js +0 -75
- package/dist/packages/observability/collectors.js.map +0 -1
- package/dist/packages/observability/index.d.ts +0 -10
- package/dist/packages/observability/index.js +0 -35
- package/dist/packages/observability/index.js.map +0 -1
- package/dist/packages/observability/metrics.d.ts +0 -119
- package/dist/packages/observability/metrics.js +0 -194
- package/dist/packages/observability/metrics.js.map +0 -1
- package/dist/packages/observability/middleware.d.ts +0 -32
- package/dist/packages/observability/middleware.js +0 -58
- package/dist/packages/observability/middleware.js.map +0 -1
- package/dist/packages/review/analysis-engine.d.ts +0 -19
- package/dist/packages/review/analysis-engine.js +0 -106
- package/dist/packages/review/analysis-engine.js.map +0 -1
- package/dist/packages/review/index.d.ts +0 -12
- package/dist/packages/review/index.js +0 -29
- package/dist/packages/review/index.js.map +0 -1
- package/dist/packages/review/parser-n8n.d.ts +0 -2
- package/dist/packages/review/parser-n8n.js +0 -118
- package/dist/packages/review/parser-n8n.js.map +0 -1
- package/dist/packages/review/providers/github.d.ts +0 -62
- package/dist/packages/review/providers/github.js +0 -275
- package/dist/packages/review/providers/github.js.map +0 -1
- package/dist/packages/review/providers.d.ts +0 -106
- package/dist/packages/review/providers.js +0 -12
- package/dist/packages/review/providers.js.map +0 -1
- package/dist/packages/review/reporter.d.ts +0 -17
- package/dist/packages/review/reporter.js +0 -53
- package/dist/packages/review/reporter.js.map +0 -1
- package/dist/packages/review/rules/index.d.ts +0 -9
- package/dist/packages/review/rules/index.js +0 -313
- package/dist/packages/review/rules/index.js.map +0 -1
- package/dist/packages/review/rules/rule-utils.d.ts +0 -36
- package/dist/packages/review/rules/rule-utils.js +0 -75
- package/dist/packages/review/rules/rule-utils.js.map +0 -1
- package/dist/packages/review/schemas/index.d.ts +0 -17
- package/dist/packages/review/schemas/index.js +0 -139
- package/dist/packages/review/schemas/index.js.map +0 -1
- package/dist/packages/review/schemas/n8n-workflow.schema.json +0 -177
- package/dist/packages/review/sniffer.d.ts +0 -15
- package/dist/packages/review/sniffer.js +0 -47
- package/dist/packages/review/sniffer.js.map +0 -1
- package/dist/packages/review/types.d.ts +0 -37
- package/dist/packages/review/types.js +0 -3
- package/dist/packages/review/types.js.map +0 -1
- package/dist/packages/review/utils/findings.d.ts +0 -23
- package/dist/packages/review/utils/findings.js +0 -34
- package/dist/packages/review/utils/findings.js.map +0 -1
- package/dist/packages/review/utils/merge.d.ts +0 -12
- package/dist/packages/review/utils/merge.js +0 -40
- package/dist/packages/review/utils/merge.js.map +0 -1
- package/dist/packages/review/utils.d.ts +0 -58
- package/dist/packages/review/utils.js +0 -208
- package/dist/packages/review/utils.js.map +0 -1
- package/dist/packages/tracing/github-tracer.d.ts +0 -38
- package/dist/packages/tracing/github-tracer.js +0 -79
- package/dist/packages/tracing/github-tracer.js.map +0 -1
- package/dist/packages/tracing/index.d.ts +0 -81
- package/dist/packages/tracing/index.js +0 -240
- package/dist/packages/tracing/index.js.map +0 -1
- package/dist/packages/tracing/tracer.d.ts +0 -30
- package/dist/packages/tracing/tracer.js +0 -141
- package/dist/packages/tracing/tracer.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,51 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowlint",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Static analysis tool for n8n workflows - detect issues early, fix them faster",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
7
|
+
"main": "dist/cli.js",
|
|
7
8
|
"bin": {
|
|
8
|
-
"flowlint": "dist/
|
|
9
|
+
"flowlint": "dist/cli.js"
|
|
9
10
|
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
10
16
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"access": "public",
|
|
15
|
-
"registry": "https://registry.npmjs.org"
|
|
16
|
-
},
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/Replikanti/flowlint.git",
|
|
20
|
-
"directory": "packages/cli"
|
|
17
|
+
"dev": "ts-node --project ../../tsconfig.json src/cli.ts",
|
|
18
|
+
"build": "tsc --project ../../tsconfig.json",
|
|
19
|
+
"test": "vitest run"
|
|
21
20
|
},
|
|
22
21
|
"keywords": [
|
|
23
22
|
"n8n",
|
|
24
23
|
"workflow",
|
|
25
24
|
"linter",
|
|
26
25
|
"static-analysis",
|
|
26
|
+
"automation",
|
|
27
27
|
"cli"
|
|
28
28
|
],
|
|
29
|
-
"
|
|
30
|
-
|
|
29
|
+
"author": "Replikanti",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/Replikanti/flowlint-app",
|
|
33
|
+
"directory": "apps/cli"
|
|
31
34
|
},
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"ajv-draft-04": "^1.0.0",
|
|
35
|
-
"ajv-formats": "^3.0.1",
|
|
36
|
-
"commander": "^12.1.0",
|
|
37
|
-
"dotenv": "^16.4.0",
|
|
38
|
-
"glob": "^10.3.10",
|
|
39
|
-
"micromatch": "^4.0.8",
|
|
40
|
-
"pino": "^10.1.0",
|
|
41
|
-
"yaml": "^2.4.0"
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/Replikanti/flowlint-app/issues"
|
|
42
37
|
},
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
"
|
|
38
|
+
"homepage": "https://flowlint.dev",
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=22"
|
|
46
41
|
},
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
]
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
}
|
|
51
45
|
}
|
package/README.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# @flowlint/cli
|
|
2
|
-
|
|
3
|
-
Static analysis for n8n workflow files. Detect missing retries, error handling, security issues, and more.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install -g @flowlint/cli
|
|
9
|
-
flowlint --help
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Quick Start
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
# Scan workflows in current directory
|
|
16
|
-
flowlint scan
|
|
17
|
-
|
|
18
|
-
# Scan specific directory with JSON output
|
|
19
|
-
flowlint scan ./workflows --format json --out-file report.json
|
|
20
|
-
|
|
21
|
-
# Fail if any MUST-severity issues found (for CI/CD)
|
|
22
|
-
flowlint scan ./workflows --fail-on-error
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Configuration
|
|
26
|
-
|
|
27
|
-
Create `.flowlint.yml` in your project:
|
|
28
|
-
|
|
29
|
-
```yaml
|
|
30
|
-
files:
|
|
31
|
-
include:
|
|
32
|
-
- "**/*.n8n.json"
|
|
33
|
-
ignore:
|
|
34
|
-
- "node_modules/**"
|
|
35
|
-
|
|
36
|
-
rules:
|
|
37
|
-
rate_limit_retry:
|
|
38
|
-
enabled: true
|
|
39
|
-
error_handling:
|
|
40
|
-
enabled: true
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## License
|
|
44
|
-
|
|
45
|
-
MIT
|
package/dist/apps/cli/src/cli.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
/**
|
|
4
|
-
* FlowLint CLI
|
|
5
|
-
*
|
|
6
|
-
* A command-line tool for static analysis of n8n workflow files.
|
|
7
|
-
* Can be used locally, in CI pipelines, or pre-commit hooks.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const commander_1 = require("commander");
|
|
11
|
-
const scan_1 = require("./commands/scan");
|
|
12
|
-
const init_1 = require("./commands/init");
|
|
13
|
-
const program = new commander_1.Command();
|
|
14
|
-
program
|
|
15
|
-
.name('flowlint')
|
|
16
|
-
.description('Static analysis tool for n8n workflows')
|
|
17
|
-
.version('0.3.0');
|
|
18
|
-
// Register commands
|
|
19
|
-
program.addCommand(scan_1.scanCommand);
|
|
20
|
-
program.addCommand(init_1.initCommand);
|
|
21
|
-
// Parse and execute
|
|
22
|
-
program.parse(process.argv);
|
|
23
|
-
// Show help if no command provided
|
|
24
|
-
if (!process.argv.slice(2).length) {
|
|
25
|
-
program.outputHelp();
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=cli.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../apps/cli/src/cli.ts"],"names":[],"mappings":";;AAEA;;;;;GAKG;;AAEH,yCAAoC;AACpC,0CAA8C;AAC9C,0CAA8C;AAE9C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,wCAAwC,CAAC;KACrD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,oBAAoB;AACpB,OAAO,CAAC,UAAU,CAAC,kBAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,kBAAW,CAAC,CAAC;AAEhC,oBAAoB;AACpB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,mCAAmC;AACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* init command - Create a .flowlint.yml configuration file interactively
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* flowlint init
|
|
7
|
-
*/
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.initCommand = void 0;
|
|
13
|
-
const commander_1 = require("commander");
|
|
14
|
-
const fs_1 = __importDefault(require("fs"));
|
|
15
|
-
const path_1 = __importDefault(require("path"));
|
|
16
|
-
const yaml_1 = __importDefault(require("yaml"));
|
|
17
|
-
const flowlint_config_1 = require('../../../../packages/config/flowlint-config');
|
|
18
|
-
exports.initCommand = new commander_1.Command('init')
|
|
19
|
-
.description('Create a .flowlint.yml configuration file')
|
|
20
|
-
.action(async () => {
|
|
21
|
-
const configPath = path_1.default.join(process.cwd(), '.flowlint.yml');
|
|
22
|
-
// Check if config already exists
|
|
23
|
-
if (fs_1.default.existsSync(configPath)) {
|
|
24
|
-
console.log('.flowlint.yml already exists. Skipping initialization.');
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
// For now, just write the default config
|
|
28
|
-
// In the future, this could be interactive
|
|
29
|
-
const yaml = yaml_1.default.stringify(flowlint_config_1.defaultConfig, { lineWidth: 120 });
|
|
30
|
-
fs_1.default.writeFileSync(configPath, yaml, 'utf8');
|
|
31
|
-
console.log(`✓ Created .flowlint.yml with default configuration`);
|
|
32
|
-
console.log(` Edit the file to customize linting rules and patterns`);
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=init.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/init.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,yCAAoC;AACpC,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AACxB,qEAAgE;AAEnD,QAAA,WAAW,GAAG,IAAI,mBAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,2CAA2C,CAAC;KACxD,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC,CAAC;IAE7D,iCAAiC;IACjC,IAAI,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;QACtE,OAAO;IACT,CAAC;IAED,yCAAyC;IACzC,2CAA2C;IAC3C,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,+BAAa,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/D,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAE3C,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* scan command - Analyze n8n workflow files in a directory
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* flowlint scan [path]
|
|
6
|
-
* flowlint scan . --config .flowlint.yml
|
|
7
|
-
* flowlint scan --format json --out-file report.json
|
|
8
|
-
* flowlint scan --fail-on-error
|
|
9
|
-
*/
|
|
10
|
-
import { Command } from 'commander';
|
|
11
|
-
export declare const scanCommand: Command;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* scan command - Analyze n8n workflow files in a directory
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* flowlint scan [path]
|
|
7
|
-
* flowlint scan . --config .flowlint.yml
|
|
8
|
-
* flowlint scan --format json --out-file report.json
|
|
9
|
-
* flowlint scan --fail-on-error
|
|
10
|
-
*/
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.scanCommand = void 0;
|
|
16
|
-
const commander_1 = require("commander");
|
|
17
|
-
const path_1 = __importDefault(require("path"));
|
|
18
|
-
const local_file_source_1 = require("../providers/local-file-source");
|
|
19
|
-
const local_config_provider_1 = require("../providers/local-config-provider");
|
|
20
|
-
const console_reporter_1 = require("../reporters/console-reporter");
|
|
21
|
-
const json_reporter_1 = require("../reporters/json-reporter");
|
|
22
|
-
const review_1 = require('../../../../packages/review');
|
|
23
|
-
exports.scanCommand = new commander_1.Command('scan')
|
|
24
|
-
.description('Scan workflow files for issues')
|
|
25
|
-
.argument('[path]', 'Directory to scan', '.')
|
|
26
|
-
.option('--config <path>', 'Path to .flowlint.yml config file')
|
|
27
|
-
.option('--format <format>', 'Output format: stylish|json', 'stylish')
|
|
28
|
-
.option('--out-file <path>', 'Write JSON results to file (implies --format json)')
|
|
29
|
-
.option('--fail-on-error', 'Exit with code 1 if errors found')
|
|
30
|
-
.action(async (scanPath, options) => {
|
|
31
|
-
try {
|
|
32
|
-
const absolutePath = path_1.default.resolve(process.cwd(), scanPath);
|
|
33
|
-
const configPath = options.config ? path_1.default.resolve(process.cwd(), options.config) : undefined;
|
|
34
|
-
const format = options.outFile ? 'json' : options.format;
|
|
35
|
-
// Initialize providers
|
|
36
|
-
const fileSource = new local_file_source_1.LocalFileSource(absolutePath);
|
|
37
|
-
const configProvider = new local_config_provider_1.LocalConfigProvider(configPath);
|
|
38
|
-
// Choose reporter based on format
|
|
39
|
-
let reporter;
|
|
40
|
-
if (format === 'json' || options.outFile) {
|
|
41
|
-
reporter = new json_reporter_1.JsonReporter(options.outFile);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
reporter = new console_reporter_1.ConsoleReporter();
|
|
45
|
-
}
|
|
46
|
-
// Run analysis
|
|
47
|
-
const engine = new review_1.DefaultAnalysisEngine(fileSource, configProvider, reporter);
|
|
48
|
-
const summary = await engine.analyze();
|
|
49
|
-
// Exit with appropriate code
|
|
50
|
-
if (options.failOnError && summary.hasBlockingIssues) {
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
console.error('Error:', error instanceof Error ? error.message : String(error));
|
|
56
|
-
process.exit(2);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=scan.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/scan.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;AAEH,yCAAoC;AACpC,gDAAwB;AACxB,sEAAiE;AACjE,8EAAyE;AACzE,oEAAgE;AAChE,8DAA0D;AAC1D,4CAAwD;AAE3C,QAAA,WAAW,GAAG,IAAI,mBAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,gCAAgC,CAAC;KAC7C,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,CAAC;KAC5C,MAAM,CAAC,iBAAiB,EAAE,mCAAmC,CAAC;KAC9D,MAAM,CAAC,mBAAmB,EAAE,6BAA6B,EAAE,SAAS,CAAC;KACrE,MAAM,CAAC,mBAAmB,EAAE,oDAAoD,CAAC;KACjF,MAAM,CAAC,iBAAiB,EAAE,kCAAkC,CAAC;KAC7D,MAAM,CAAC,KAAK,EAAE,QAAgB,EAAE,OAAY,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC3D,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE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lint.yml from the local filesystem
|
|
4
|
-
*/
|
|
5
|
-
import { type FlowLintConfig } from 'packages/config/flowlint-config';
|
|
6
|
-
import type { ConfigProvider } from 'packages/review/providers';
|
|
7
|
-
export declare class LocalConfigProvider implements ConfigProvider {
|
|
8
|
-
private configPath?;
|
|
9
|
-
constructor(configPath?: string | undefined);
|
|
10
|
-
load(): Promise<FlowLintConfig>;
|
|
11
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Local Config Provider
|
|
4
|
-
* Loads .flowlint.yml from the local filesystem
|
|
5
|
-
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.LocalConfigProvider = void 0;
|
|
11
|
-
const fs_1 = __importDefault(require("fs"));
|
|
12
|
-
const path_1 = __importDefault(require("path"));
|
|
13
|
-
const yaml_1 = __importDefault(require("yaml"));
|
|
14
|
-
const flowlint_config_1 = require('../../../../packages/config/flowlint-config');
|
|
15
|
-
const merge_1 = require('../../../../packages/review/utils/merge');
|
|
16
|
-
class LocalConfigProvider {
|
|
17
|
-
constructor(configPath) {
|
|
18
|
-
this.configPath = configPath;
|
|
19
|
-
}
|
|
20
|
-
async load() {
|
|
21
|
-
// Determine config file path
|
|
22
|
-
const configFile = this.configPath || path_1.default.join(process.cwd(), '.flowlint.yml');
|
|
23
|
-
// If config doesn't exist, return defaults
|
|
24
|
-
if (!fs_1.default.existsSync(configFile)) {
|
|
25
|
-
return flowlint_config_1.defaultConfig;
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
const content = fs_1.default.readFileSync(configFile, 'utf8');
|
|
29
|
-
const parsed = yaml_1.default.parse(content) || {};
|
|
30
|
-
return (0, merge_1.deepMerge)(flowlint_config_1.defaultConfig, parsed);
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
console.warn(`Failed to load config from ${configFile}: ${error}`);
|
|
34
|
-
return flowlint_config_1.defaultConfig;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.LocalConfigProvider = LocalConfigProvider;
|
|
39
|
-
//# sourceMappingURL=local-config-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-config-provider.js","sourceRoot":"","sources":["../../../../../apps/cli/src/providers/local-config-provider.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AACxB,qEAAqF;AAErF,uDAAwD;AAExD,MAAa,mBAAmB;IAC9B,YAAoB,UAAmB;QAAnB,eAAU,GAAV,UAAU,CAAS;IAAG,CAAC;IAE3C,KAAK,CAAC,IAAI;QACR,6BAA6B;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC,CAAC;QAEhF,2CAA2C;QAC3C,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/B,OAAO,+BAAa,CAAC;QACvB,CAAC;QAED,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACpD,MAAM,MAAM,GAAI,cAAI,CAAC,KAAK,CAAC,OAAO,CAA6B,IAAI,EAAE,CAAC;YACtE,OAAO,IAAA,iBAAS,EAAC,+BAAa,EAAE,MAAM,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,8BAA8B,UAAU,KAAK,KAAK,EAAE,CAAC,CAAC;YACnE,OAAO,+BAAa,CAAC;QACvB,CAAC;IACH,CAAC;CACF;AArBD,kDAqBC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local File Source Provider
|
|
3
|
-
* Reads workflow files from the local filesystem
|
|
4
|
-
*/
|
|
5
|
-
import type { FileSource, LintableFile } from 'packages/review/providers';
|
|
6
|
-
export declare class LocalFileSource implements FileSource {
|
|
7
|
-
private basePath;
|
|
8
|
-
constructor(basePath: string);
|
|
9
|
-
getFiles(patterns: {
|
|
10
|
-
include: string[];
|
|
11
|
-
ignore: string[];
|
|
12
|
-
}): Promise<LintableFile[]>;
|
|
13
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Local File Source Provider
|
|
4
|
-
* Reads workflow files from the local filesystem
|
|
5
|
-
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.LocalFileSource = void 0;
|
|
11
|
-
const fs_1 = __importDefault(require("fs"));
|
|
12
|
-
const path_1 = __importDefault(require("path"));
|
|
13
|
-
const glob_1 = require("glob");
|
|
14
|
-
class LocalFileSource {
|
|
15
|
-
constructor(basePath) {
|
|
16
|
-
this.basePath = basePath;
|
|
17
|
-
}
|
|
18
|
-
async getFiles(patterns) {
|
|
19
|
-
const files = [];
|
|
20
|
-
for (const pattern of patterns.include) {
|
|
21
|
-
// Construct glob pattern relative to basePath
|
|
22
|
-
const globPattern = path_1.default.join(this.basePath, pattern);
|
|
23
|
-
const matches = (0, glob_1.globSync)(globPattern, {
|
|
24
|
-
ignore: patterns.ignore.map((ignorePattern) => path_1.default.join(this.basePath, ignorePattern)),
|
|
25
|
-
nodir: true,
|
|
26
|
-
});
|
|
27
|
-
for (const filePath of matches) {
|
|
28
|
-
try {
|
|
29
|
-
const content = fs_1.default.readFileSync(filePath, 'utf8');
|
|
30
|
-
const relativePath = path_1.default.relative(this.basePath, filePath);
|
|
31
|
-
files.push({
|
|
32
|
-
path: relativePath,
|
|
33
|
-
content,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
console.warn(`Failed to read file ${filePath}: ${error}`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Remove duplicates (same file matched multiple patterns)
|
|
42
|
-
const uniqueFiles = Array.from(new Map(files.map((f) => [f.path, f])).values());
|
|
43
|
-
return uniqueFiles;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.LocalFileSource = LocalFileSource;
|
|
47
|
-
//# sourceMappingURL=local-file-source.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-file-source.js","sourceRoot":"","sources":["../../../../../apps/cli/src/providers/local-file-source.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,4CAAoB;AACpB,gDAAwB;AACxB,+BAAgC;AAGhC,MAAa,eAAe;IAC1B,YAAoB,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;IAExC,KAAK,CAAC,QAAQ,CAAC,QAAiD;QAC9D,MAAM,KAAK,GAAmB,EAAE,CAAC;QAEjC,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACvC,8CAA8C;YAC9C,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAEtD,MAAM,OAAO,GAAG,IAAA,eAAQ,EAAC,WAAW,EAAE;gBACpC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBACvF,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;YAEH,KAAK,MAAM,QAAQ,IAAI,OAAO,EAAE,CAAC;gBAC/B,IAAI,CAAC;oBACH,MAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;oBAClD,MAAM,YAAY,GAAG,cAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;oBAE5D,KAAK,CAAC,IAAI,CAAC;wBACT,IAAI,EAAE,YAAY;wBAClB,OAAO;qBACR,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,IAAI,CAAC,uBAAuB,QAAQ,KAAK,KAAK,EAAE,CAAC,CAAC;gBAC5D,CAAC;YACH,CAAC;QACH,CAAC;QAED,0DAA0D;QAC1D,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAC5B,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAChD,CAAC;QAEF,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AArCD,0CAqCC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Console Reporter
|
|
3
|
-
* Outputs findings to the terminal with colors and formatting
|
|
4
|
-
*/
|
|
5
|
-
import type { AnalysisResult, Reporter } from 'packages/review/providers';
|
|
6
|
-
export declare class ConsoleReporter implements Reporter {
|
|
7
|
-
report(results: AnalysisResult[]): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Console Reporter
|
|
4
|
-
* Outputs findings to the terminal with colors and formatting
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ConsoleReporter = void 0;
|
|
8
|
-
const findings_1 = require('../../../../packages/review/utils/findings');
|
|
9
|
-
const colors = {
|
|
10
|
-
reset: '\x1b[0m',
|
|
11
|
-
bold: '\x1b[1m',
|
|
12
|
-
red: '\x1b[31m',
|
|
13
|
-
yellow: '\x1b[33m',
|
|
14
|
-
blue: '\x1b[36m',
|
|
15
|
-
gray: '\x1b[90m',
|
|
16
|
-
};
|
|
17
|
-
class ConsoleReporter {
|
|
18
|
-
async report(results) {
|
|
19
|
-
const allFindings = results.flatMap((r) => r.findings);
|
|
20
|
-
// Print header
|
|
21
|
-
console.log();
|
|
22
|
-
console.log(`${colors.blue}${colors.bold}FlowLint Analysis Report${colors.reset} ${colors.gray}${new Date().toLocaleTimeString()}${colors.reset}`);
|
|
23
|
-
console.log(colors.gray + '─'.repeat(80) + colors.reset);
|
|
24
|
-
console.log();
|
|
25
|
-
// Print findings grouped by file
|
|
26
|
-
for (const result of results) {
|
|
27
|
-
if (result.findings.length === 0 && !result.errors)
|
|
28
|
-
continue;
|
|
29
|
-
const { path } = result.file;
|
|
30
|
-
console.log(`${colors.bold}${path}${colors.reset}`);
|
|
31
|
-
const sortedFindings = (0, findings_1.sortFindingsBySeverity)(result.findings);
|
|
32
|
-
for (const finding of sortedFindings) {
|
|
33
|
-
const severityColor = finding.severity === 'must'
|
|
34
|
-
? colors.red
|
|
35
|
-
: finding.severity === 'should'
|
|
36
|
-
? colors.yellow
|
|
37
|
-
: colors.gray;
|
|
38
|
-
const line = finding.line ? `:${finding.line}` : '';
|
|
39
|
-
const severity = finding.severity.toUpperCase();
|
|
40
|
-
console.log(` ${severityColor}${severity}${colors.reset} ${colors.bold}${finding.rule}${colors.reset} ${finding.message}`);
|
|
41
|
-
console.log(` at ${colors.gray}${path}${line}${colors.reset}`);
|
|
42
|
-
if (finding.raw_details) {
|
|
43
|
-
const details = finding.raw_details.split('\n').slice(0, 3);
|
|
44
|
-
for (const detail of details) {
|
|
45
|
-
console.log(` ${colors.gray}${detail}${colors.reset}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
console.log();
|
|
50
|
-
}
|
|
51
|
-
// Print summary
|
|
52
|
-
const summary = (0, findings_1.countFindingsBySeverity)(allFindings);
|
|
53
|
-
console.log(colors.gray + '─'.repeat(80) + colors.reset);
|
|
54
|
-
console.log();
|
|
55
|
-
if (summary.total === 0) {
|
|
56
|
-
console.log(`${colors.bold}✓ No issues found${colors.reset}`);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
const summaryParts = [];
|
|
60
|
-
if (summary.must > 0)
|
|
61
|
-
summaryParts.push(`${colors.red}${summary.must} must-fix${colors.reset}`);
|
|
62
|
-
if (summary.should > 0)
|
|
63
|
-
summaryParts.push(`${colors.yellow}${summary.should} should-fix${colors.reset}`);
|
|
64
|
-
if (summary.nit > 0)
|
|
65
|
-
summaryParts.push(`${colors.gray}${summary.nit} nit${colors.reset}`);
|
|
66
|
-
console.log(`${colors.bold}Found: ${summaryParts.join(', ')}${colors.reset}`);
|
|
67
|
-
}
|
|
68
|
-
console.log();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.ConsoleReporter = ConsoleReporter;
|
|
72
|
-
//# sourceMappingURL=console-reporter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"console-reporter.js","sourceRoot":"","sources":["../../../../../apps/cli/src/reporters/console-reporter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,6DAAmH;AAWnH,MAAM,MAAM,GAAe;IACzB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,MAAa,eAAe;IAC1B,KAAK,CAAC,MAAM,CAAC,OAAyB;QACpC,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CA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AAG,EAAE,CAAC;YACxB,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC;gBAAE,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC,IAAI,YAAY,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAChG,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;gBAAE,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,cAAc,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YACzG,IAAI,OAAO,CAAC,GAAG,GAAG,CAAC;gBAAE,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAE1F,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,UAAU,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;CACF;AAnED,0CAmEC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JSON Reporter
|
|
3
|
-
* Outputs findings as structured JSON
|
|
4
|
-
* Suitable for:
|
|
5
|
-
* - Integration with other tools
|
|
6
|
-
* - Uploading to Web Dashboard (future)
|
|
7
|
-
* - Programmatic processing
|
|
8
|
-
*/
|
|
9
|
-
import type { AnalysisResult, Reporter } from 'packages/review/providers';
|
|
10
|
-
export declare class JsonReporter implements Reporter {
|
|
11
|
-
private outputFile?;
|
|
12
|
-
constructor(outputFile?: string | undefined);
|
|
13
|
-
report(results: AnalysisResult[]): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* JSON Reporter
|
|
4
|
-
* Outputs findings as structured JSON
|
|
5
|
-
* Suitable for:
|
|
6
|
-
* - Integration with other tools
|
|
7
|
-
* - Uploading to Web Dashboard (future)
|
|
8
|
-
* - Programmatic processing
|
|
9
|
-
*/
|
|
10
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.JsonReporter = void 0;
|
|
15
|
-
const fs_1 = __importDefault(require("fs"));
|
|
16
|
-
const findings_1 = require('../../../../packages/review/utils/findings');
|
|
17
|
-
class JsonReporter {
|
|
18
|
-
constructor(outputFile) {
|
|
19
|
-
this.outputFile = outputFile;
|
|
20
|
-
}
|
|
21
|
-
async report(results) {
|
|
22
|
-
const allFindings = results.flatMap((r) => r.findings);
|
|
23
|
-
const severitySummary = (0, findings_1.countFindingsBySeverity)(allFindings);
|
|
24
|
-
const report = {
|
|
25
|
-
version: '1.0',
|
|
26
|
-
timestamp: new Date().toISOString(),
|
|
27
|
-
summary: {
|
|
28
|
-
totalFiles: results.length,
|
|
29
|
-
totalFindings: severitySummary.total,
|
|
30
|
-
findingsBySeverity: {
|
|
31
|
-
must: severitySummary.must,
|
|
32
|
-
should: severitySummary.should,
|
|
33
|
-
nit: severitySummary.nit,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
results: results.map((result) => ({
|
|
37
|
-
file: {
|
|
38
|
-
path: result.file.path,
|
|
39
|
-
},
|
|
40
|
-
findings: result.findings,
|
|
41
|
-
errors: result.errors,
|
|
42
|
-
})),
|
|
43
|
-
};
|
|
44
|
-
const json = JSON.stringify(report, null, 2);
|
|
45
|
-
if (this.outputFile) {
|
|
46
|
-
// Write to file
|
|
47
|
-
fs_1.default.writeFileSync(this.outputFile, json, 'utf8');
|
|
48
|
-
console.log(`✓ Report written to ${this.outputFile}`);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
// Print to stdout
|
|
52
|
-
console.log(json);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.JsonReporter = JsonReporter;
|
|
57
|
-
//# sourceMappingURL=json-reporter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-reporter.js","sourceRoot":"","sources":["../../../../../apps/cli/src/reporters/json-reporter.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;AAEH,4CAAoB;AAEpB,6DAAyE;AAkCzE,MAAa,YAAY;IACvB,YAAoB,UAAmB;QAAnB,eAAU,GAAV,UAAU,CAAS;IAAG,CAAC;IAE3C,KAAK,CAAC,MAAM,CAAC,OAAyB;QACpC,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,eAAe,GAAG,IAAA,kCAAuB,EAAC,WAAW,CAAC,CAAC;QAE7D,MAAM,MAAM,GAAe;YACzB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,OAAO,EAAE;gBACP,UAAU,EAAE,OAAO,CAAC,MAAM;gBAC1B,aAAa,EAAE,eAAe,CAAC,KAAK;gBACpC,kBAAkB,EAAE;oBAClB,IAAI,EAAE,eAAe,CAAC,IAAI;oBAC1B,MAAM,EAAE,eAAe,CAAC,MAAM;oBAC9B,GAAG,EAAE,eAAe,CAAC,GAAG;iBACzB;aACF;YACD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBAChC,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;iBACvB;gBACD,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;SACJ,CAAC;QAEF,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAE7C,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,gBAAgB;YAChB,YAAE,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YAChD,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,kBAAkB;YAClB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;CACF;AAvCD,oCAuCC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Octokit } from 'octokit';
|
|
2
|
-
export type FlowLintConfig = typeof defaultConfig;
|
|
3
|
-
export declare const defaultConfig: {
|
|
4
|
-
files: {
|
|
5
|
-
include: string[];
|
|
6
|
-
ignore: string[];
|
|
7
|
-
};
|
|
8
|
-
report: {
|
|
9
|
-
annotations: boolean;
|
|
10
|
-
summary_limit: number;
|
|
11
|
-
};
|
|
12
|
-
rules: {
|
|
13
|
-
rate_limit_retry: {
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
max_concurrency: number;
|
|
16
|
-
default_retry: {
|
|
17
|
-
count: number;
|
|
18
|
-
strategy: string;
|
|
19
|
-
base_ms: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
error_handling: {
|
|
23
|
-
enabled: boolean;
|
|
24
|
-
forbid_continue_on_fail: boolean;
|
|
25
|
-
};
|
|
26
|
-
idempotency: {
|
|
27
|
-
enabled: boolean;
|
|
28
|
-
key_field_candidates: string[];
|
|
29
|
-
};
|
|
30
|
-
secrets: {
|
|
31
|
-
enabled: boolean;
|
|
32
|
-
denylist_regex: string[];
|
|
33
|
-
};
|
|
34
|
-
dead_ends: {
|
|
35
|
-
enabled: boolean;
|
|
36
|
-
};
|
|
37
|
-
long_running: {
|
|
38
|
-
enabled: boolean;
|
|
39
|
-
max_iterations: number;
|
|
40
|
-
timeout_ms: number;
|
|
41
|
-
};
|
|
42
|
-
unused_data: {
|
|
43
|
-
enabled: boolean;
|
|
44
|
-
};
|
|
45
|
-
unhandled_error_path: {
|
|
46
|
-
enabled: boolean;
|
|
47
|
-
};
|
|
48
|
-
alert_log_enforcement: {
|
|
49
|
-
enabled: boolean;
|
|
50
|
-
};
|
|
51
|
-
deprecated_nodes: {
|
|
52
|
-
enabled: boolean;
|
|
53
|
-
};
|
|
54
|
-
naming_convention: {
|
|
55
|
-
enabled: boolean;
|
|
56
|
-
generic_names: string[];
|
|
57
|
-
};
|
|
58
|
-
config_literals: {
|
|
59
|
-
enabled: boolean;
|
|
60
|
-
denylist_regex: string[];
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export declare function loadConfig(gh: Octokit, repoFull: string, sha: string): Promise<FlowLintConfig>;
|