@atlisp/lint 0.2.14 → 0.2.15

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.
@@ -100,7 +100,15 @@ function globFiles(pattern, rootDir) {
100
100
  }
101
101
  function collectFiles(rootDir, opts, config) {
102
102
  const files = new Set();
103
- if (opts.src.length > 0 || opts.test.length > 0) {
103
+ if (opts.files.length > 0) {
104
+ for (const f of opts.files) {
105
+ const resolved = path.resolve(rootDir, f);
106
+ if (fs.existsSync(resolved) && resolved.endsWith('.lsp')) {
107
+ files.add(resolved);
108
+ }
109
+ }
110
+ }
111
+ else if (opts.src.length > 0 || opts.test.length > 0) {
104
112
  for (const d of opts.src) {
105
113
  for (const f of globFiles('**/*.lsp', path.resolve(rootDir, d))) {
106
114
  files.add(f);
@@ -1,6 +1,7 @@
1
1
  export interface CliOptions {
2
2
  src: string[];
3
3
  test: string[];
4
+ files: string[];
4
5
  config?: string;
5
6
  staged: boolean;
6
7
  diff: boolean;
@@ -6,6 +6,7 @@ function parseArgs() {
6
6
  const opts = {
7
7
  src: [],
8
8
  test: [],
9
+ files: [],
9
10
  staged: false,
10
11
  diff: false,
11
12
  changed: '',
@@ -38,6 +39,9 @@ function parseArgs() {
38
39
  case '--test':
39
40
  opts.test.push(argv[++i]);
40
41
  break;
42
+ case '--file':
43
+ opts.files.push(argv[++i]);
44
+ break;
41
45
  case '--config':
42
46
  opts.config = argv[++i];
43
47
  break;
@@ -111,6 +115,9 @@ function parseArgs() {
111
115
  opts.maxWarnings = parseInt(argv[++i], 10);
112
116
  break;
113
117
  default:
118
+ if (!argv[i].startsWith('--')) {
119
+ opts.files.push(argv[i]);
120
+ }
114
121
  break;
115
122
  }
116
123
  }
package/dist/locale.js CHANGED
@@ -125,6 +125,7 @@ Usage: atlisp-lint [options]
125
125
  Options:
126
126
  --src <dir> Specify source directory (may be repeated)
127
127
  --test <dir> Specify test directory (may be repeated)
128
+ --file <path> Lint a specific .lsp file (may be repeated, or pass as positional arg)
128
129
  --config <path> Path to config file
129
130
  --staged Only check git staged .lsp files
130
131
  --format <format> Output format: default | json
@@ -268,6 +269,7 @@ Options:
268
269
  选项:
269
270
  --src <目录> 指定源代码目录(可重复)
270
271
  --test <目录> 指定测试目录(可重复)
272
+ --file <路径> 检查指定 .lsp 文件(可重复,也可以直接传位置参数)
271
273
  --config <路径> 配置文件路径
272
274
  --staged 仅检查 git 暂存区的 .lsp 文件
273
275
  --format <格式> 输出格式:default | json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlisp/lint",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "AutoLISP static analysis tool — parens, security, conventions, SBCL syntax validation",
5
5
  "keywords": [
6
6
  "CAD",