@atlisp/lint 0.1.30 → 0.2.1

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.
@@ -37,8 +37,13 @@ function isInQuote(node) {
37
37
  return false;
38
38
  }
39
39
  function isWrappedByCatchError(node) {
40
- const parent = node.parent;
41
- return !!(parent && (0, parser_1.astIsList)(parent, 'vl-catch-all-error-p'));
40
+ let p = node.parent;
41
+ while (p) {
42
+ if ((0, parser_1.astIsList)(p, 'vl-catch-all-error-p'))
43
+ return true;
44
+ p = p.parent;
45
+ }
46
+ return false;
42
47
  }
43
48
  function isSetqStored(node) {
44
49
  const parent = node.parent;
package/dist/config.js CHANGED
@@ -54,42 +54,42 @@ const DEFAULT_CONFIG = {
54
54
  command_shell: 'warn',
55
55
  startapp: 'warn',
56
56
  vl_registry_write: 'warn',
57
- vlax_without_loading: 'warn',
57
+ vlax_without_loading: 'info',
58
58
  token_in_url: 'warn',
59
59
  open_without_close: 'warn',
60
60
  bare_function_names: 'off',
61
- line_length: 'warn',
61
+ line_length: 'info',
62
62
  function_complexity: 'warn',
63
- parameter_naming: 'warn',
63
+ parameter_naming: 'info',
64
64
  unused_variable: 'warn',
65
- missing_doc: 'warn',
66
- trailing_whitespace: 'warn',
65
+ missing_doc: 'info',
66
+ trailing_whitespace: 'info',
67
67
  undeclared_setq: 'warn',
68
68
  module_registration: 'off',
69
69
  namespace_header: 'off',
70
70
  unused_parameter: 'warn',
71
71
  constant_condition: 'warn',
72
- redundant_progn: 'warn',
72
+ redundant_progn: 'info',
73
73
  empty_branch: 'warn',
74
74
  unused_let_binding: 'warn',
75
75
  recursive_call: 'warn',
76
76
  variable_shadow: 'warn',
77
77
  unused_local_fun: 'warn',
78
- multiple_setq: 'off',
79
- redundant_quotes: 'warn',
78
+ multiple_setq: 'info',
79
+ redundant_quotes: 'info',
80
80
  trailing_paren: 'warn',
81
- empty_comment: 'warn',
81
+ empty_comment: 'info',
82
82
  redundant_setq: 'warn',
83
- redundant_nil_else: 'warn',
84
- single_arg_and_or: 'warn',
85
- redundant_let: 'warn',
83
+ redundant_nil_else: 'info',
84
+ single_arg_and_or: 'info',
85
+ redundant_let: 'info',
86
86
  self_compare: 'warn',
87
- misplaced_else: 'warn',
87
+ misplaced_else: 'info',
88
88
  quote_vs_function: 'warn',
89
89
  commented_code: 'warn',
90
- double_not: 'warn',
90
+ double_not: 'info',
91
91
  setq_single_arg: 'warn',
92
- assoc_without_cdr: 'warn',
92
+ assoc_without_cdr: 'info',
93
93
  identical_branches: 'warn',
94
94
  while_constant: 'warn',
95
95
  cond_duplicate: 'warn',
@@ -98,35 +98,35 @@ const DEFAULT_CONFIG = {
98
98
  missing_export: 'warn',
99
99
  unused_package_dep: 'warn',
100
100
  error_handling: 'warn',
101
- global_naming: 'warn',
101
+ global_naming: 'info',
102
102
  extra_parens: 'warn',
103
103
  arg_count: 'warn',
104
104
  builtin_arg_count: 'error',
105
- strcat_usage: 'warn',
106
- cond_simplify: 'warn',
107
- quote_style: 'warn',
105
+ strcat_usage: 'info',
106
+ cond_simplify: 'info',
107
+ quote_style: 'info',
108
108
  eq_usage: 'warn',
109
109
  lambda_syntax: 'off',
110
- comment_style: 'warn',
110
+ comment_style: 'info',
111
111
  empty_catch: 'warn',
112
- nth_usage: 'warn',
113
- append_single: 'warn',
112
+ nth_usage: 'info',
113
+ append_single: 'info',
114
114
  setq_multiple: 'warn',
115
115
  function_order: 'off',
116
- magic_number: 'off',
117
- mixed_indent: 'warn',
118
- long_function_call: 'warn',
119
- no_return: 'warn',
116
+ magic_number: 'info',
117
+ mixed_indent: 'info',
118
+ long_function_call: 'info',
119
+ no_return: 'info',
120
120
  shadow_builtin: 'warn',
121
121
  dynamic_doc: 'warn',
122
- loop_optimization: 'off',
123
- type_check: 'off',
122
+ loop_optimization: 'info',
123
+ type_check: 'info',
124
124
  format_indent: 'off',
125
- redundant_if: 'warn',
126
- unused_catch_result: 'off',
127
- string_concat_loop: 'off',
125
+ redundant_if: 'info',
126
+ unused_catch_result: 'info',
127
+ string_concat_loop: 'info',
128
128
  if_without_else: 'off',
129
- redundant_list: 'warn',
129
+ redundant_list: 'info',
130
130
  entget_in_loop: 'warn',
131
131
  promise_handler: 'off',
132
132
  module_cycle: 'warn',
@@ -14,7 +14,9 @@ function formatHtml(issues, errorCount, warningCount) {
14
14
  for (const iss of issues) {
15
15
  const tag = iss.severity === 'error'
16
16
  ? '<span class="badge bg-danger">ERROR</span>'
17
- : '<span class="badge bg-warning text-dark">WARN</span>';
17
+ : iss.severity === 'warn'
18
+ ? '<span class="badge bg-warning text-dark">WARN</span>'
19
+ : '<span class="badge bg-info text-dark">INFO</span>';
18
20
  rows += `<tr><td>${tag}</td><td>${iss.rule}</td><td>${iss.file}</td><td>${iss.line || '-'}</td><td>${escHtml(iss.message)}</td></tr>\n`;
19
21
  }
20
22
  let summaryHtml = '';
@@ -63,7 +65,7 @@ function formatHtml(issues, errorCount, warningCount) {
63
65
  <span class="fw-bold">${escHtml(iss.file)}:${iss.line || '-'}</span>
64
66
  <br><span class="text-muted">${escHtml(iss.message)}</span>
65
67
  </div>
66
- ${iss.severity === 'error' ? '<span class="badge bg-danger rounded-pill">ERROR</span>' : '<span class="badge bg-warning text-dark rounded-pill">WARN</span>'}
68
+ ${iss.severity === 'error' ? '<span class="badge bg-danger rounded-pill">ERROR</span>' : iss.severity === 'warn' ? '<span class="badge bg-warning text-dark rounded-pill">WARN</span>' : '<span class="badge bg-info text-dark rounded-pill">INFO</span>'}
67
69
  </li>
68
70
  `).join('')}
69
71
  </ul>
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatSarif = formatSarif;
4
4
  function formatSarif(issues, errorCount, warningCount) {
5
5
  const results = issues.map(iss => {
6
- const level = iss.severity === 'error' ? 'error' : 'warning';
6
+ const level = iss.severity === 'error' ? 'error' : iss.severity === 'warn' ? 'warning' : 'note';
7
7
  return {
8
8
  level,
9
9
  message: {
@@ -32,7 +32,7 @@ function formatSarif(issues, errorCount, warningCount) {
32
32
  tool: {
33
33
  driver: {
34
34
  name: '@atlisp/lint',
35
- version: '0.1.18',
35
+ version: '0.2.0',
36
36
  informationUri: 'https://github.com/atlisp/lint',
37
37
  rules: issues.map(iss => ({
38
38
  id: iss.rule,
@@ -22,8 +22,8 @@ function formatDefault(issues, fileContents) {
22
22
  errors++;
23
23
  else if (iss.severity === 'warn')
24
24
  warnings++;
25
- const tagColor = iss.severity === 'error' ? colors.red : colors.yellow;
26
- const tag = iss.severity === 'error' ? (0, locale_1.t)('summary.tag_fail') : (0, locale_1.t)('summary.tag_warn');
25
+ const tagColor = iss.severity === 'error' ? colors.red : iss.severity === 'warn' ? colors.yellow : colors.cyan;
26
+ const tag = iss.severity === 'error' ? (0, locale_1.t)('summary.tag_fail') : iss.severity === 'warn' ? (0, locale_1.t)('summary.tag_warn') : (0, locale_1.t)('summary.tag_info');
27
27
  const loc = iss.line > 0 ? `${(0, locale_1.t)('summary.line')} ${iss.line}` : '';
28
28
  const prefix = useColor ? `${tagColor}${tag}${colors.reset}` : tag;
29
29
  lines.push(`${prefix}: ${iss.file} — ${loc}${loc ? ': ' : ''}${iss.message}`.trim());
@@ -46,33 +46,38 @@ function formatDefault(issues, fileContents) {
46
46
  if (lines.length > 0)
47
47
  lines.push('');
48
48
  const summaryColor = errors > 0 ? colors.red : warnings > 0 ? colors.yellow : colors.cyan;
49
+ const infoCount = issues.filter(i => i.severity === 'info').length;
49
50
  if (useColor) {
50
51
  lines.push(`${colors.cyan}${(0, locale_1.t)('summary.header')}${colors.reset}`);
51
- if (errors === 0 && warnings === 0) {
52
+ if (errors === 0 && warnings === 0 && infoCount === 0) {
52
53
  lines.push(`${colors.gray}${(0, locale_1.t)('summary.all_ok')}${colors.reset}`);
53
54
  }
54
55
  else {
55
- lines.push(`${summaryColor}${(0, locale_1.t)('summary.errors_warnings', errors, warnings)}${colors.reset}`);
56
+ lines.push(`${summaryColor}${(0, locale_1.t)('summary.errors_warnings', errors, warnings, infoCount)}${colors.reset}`);
56
57
  }
57
58
  lines.push(`${colors.cyan}${(0, locale_1.t)('summary.done')}${colors.reset}`);
58
59
  }
59
60
  else {
60
61
  lines.push((0, locale_1.t)('summary.header'));
61
- if (errors === 0 && warnings === 0) {
62
+ if (errors === 0 && warnings === 0 && infoCount === 0) {
62
63
  lines.push((0, locale_1.t)('summary.all_ok'));
63
64
  }
64
65
  else {
65
- lines.push((0, locale_1.t)('summary.errors_warnings', errors, warnings));
66
+ lines.push((0, locale_1.t)('summary.errors_warnings', errors, warnings, infoCount));
66
67
  }
67
68
  lines.push((0, locale_1.t)('summary.done'));
68
69
  }
69
70
  return lines.join('\n');
70
71
  }
71
72
  function formatJson(issues, errorCount, warningCount) {
73
+ const err = errorCount ?? issues.filter(i => i.severity === 'error').length;
74
+ const warn = warningCount ?? issues.filter(i => i.severity === 'warn').length;
75
+ const info = issues.filter(i => i.severity === 'info').length;
72
76
  return JSON.stringify({
73
77
  issues,
74
- error_count: errorCount ?? issues.filter(i => i.severity === 'error').length,
75
- warning_count: warningCount ?? issues.filter(i => i.severity === 'warn').length,
78
+ error_count: err,
79
+ warning_count: warn,
80
+ info_count: info,
76
81
  }, null, 2);
77
82
  }
78
83
  //# sourceMappingURL=formatters.js.map
package/dist/locale.js CHANGED
@@ -74,10 +74,11 @@ const messages = {
74
74
  'sbcl.not_found': 'SBCL (Steel Bank Common Lisp) is required but not found.\nInstall it from: https://www.sbcl.org/platform-table.html\nOr on Windows via: winget install sbcl\nOr on macOS via: brew install sbcl\nOr on Linux via: apt install sbcl',
75
75
  'summary.tag_fail': 'FAIL',
76
76
  'summary.tag_warn': 'WARN',
77
+ 'summary.tag_info': 'INFO',
77
78
  'summary.line': 'Line',
78
79
  'summary.header': '=== Summary ===',
79
80
  'summary.all_ok': ' All files OK',
80
- 'summary.errors_warnings': ' {0} error(s), {1} warning(s)',
81
+ 'summary.errors_warnings': ' {0} error(s), {1} warning(s), {2} info(s)',
81
82
  'summary.done': '=== Done ===',
82
83
  'index.no_files': 'No .lsp files found',
83
84
  'index.config_exists': 'atlisp-lint.json already exists',
@@ -197,10 +198,11 @@ Options:
197
198
  'sbcl.not_found': '未找到 SBCL(Steel Bank Common Lisp)。\n请从以下地址安装:https://www.sbcl.org/platform-table.html\nWindows 下可用:winget install sbcl\nmacOS 下可用:brew install sbcl\nLinux 下可用:apt install sbcl',
198
199
  'summary.tag_fail': '失败',
199
200
  'summary.tag_warn': '警告',
201
+ 'summary.tag_info': '信息',
200
202
  'summary.line': '行',
201
203
  'summary.header': '=== 概要 ===',
202
204
  'summary.all_ok': ' 所有文件检查通过',
203
- 'summary.errors_warnings': ' {0} 个错误,{1} 个警告',
205
+ 'summary.errors_warnings': ' {0} 个错误,{1} 个警告,{2} 条信息',
204
206
  'summary.done': '=== 完成 ===',
205
207
  'index.no_files': '未找到 .lsp 文件',
206
208
  'index.config_exists': 'atlisp-lint.json 已存在',
package/dist/presets.js CHANGED
@@ -13,63 +13,63 @@ exports.PRESETS = {
13
13
  vl_registry_write: 'off',
14
14
  token_in_url: 'warn',
15
15
  open_without_close: 'warn',
16
- line_length: 'warn',
16
+ line_length: 'info',
17
17
  function_complexity: 'warn',
18
- parameter_naming: 'warn',
18
+ parameter_naming: 'info',
19
19
  unused_variable: 'warn',
20
- missing_doc: 'warn',
21
- trailing_whitespace: 'warn',
20
+ missing_doc: 'info',
21
+ trailing_whitespace: 'info',
22
22
  unused_parameter: 'warn',
23
23
  constant_condition: 'warn',
24
- redundant_progn: 'warn',
24
+ redundant_progn: 'info',
25
25
  empty_branch: 'warn',
26
26
  unused_let_binding: 'warn',
27
27
  recursive_call: 'warn',
28
28
  variable_shadow: 'warn',
29
29
  unused_local_fun: 'warn',
30
- multiple_setq: 'off',
31
- redundant_quotes: 'warn',
30
+ multiple_setq: 'info',
31
+ redundant_quotes: 'info',
32
32
  trailing_paren: 'warn',
33
- empty_comment: 'warn',
33
+ empty_comment: 'info',
34
34
  redundant_setq: 'warn',
35
- redundant_nil_else: 'warn',
36
- single_arg_and_or: 'warn',
37
- redundant_let: 'warn',
35
+ redundant_nil_else: 'info',
36
+ single_arg_and_or: 'info',
37
+ redundant_let: 'info',
38
38
  self_compare: 'warn',
39
- misplaced_else: 'warn',
39
+ misplaced_else: 'info',
40
40
  quote_vs_function: 'warn',
41
41
  commented_code: 'warn',
42
- double_not: 'warn',
42
+ double_not: 'info',
43
43
  setq_single_arg: 'warn',
44
- assoc_without_cdr: 'warn',
44
+ assoc_without_cdr: 'info',
45
45
  identical_branches: 'warn',
46
46
  while_constant: 'warn',
47
47
  cond_duplicate: 'warn',
48
48
  error_handling: 'warn',
49
- global_naming: 'warn',
49
+ global_naming: 'info',
50
50
  extra_parens: 'warn',
51
51
  arg_count: 'warn',
52
52
  builtin_arg_count: 'error',
53
- strcat_usage: 'warn',
54
- cond_simplify: 'warn',
55
- quote_style: 'warn',
53
+ strcat_usage: 'info',
54
+ cond_simplify: 'info',
55
+ quote_style: 'info',
56
56
  eq_usage: 'warn',
57
57
  lambda_syntax: 'off',
58
- comment_style: 'warn',
58
+ comment_style: 'info',
59
59
  empty_catch: 'warn',
60
- nth_usage: 'warn',
61
- append_single: 'warn',
60
+ nth_usage: 'info',
61
+ append_single: 'info',
62
62
  setq_multiple: 'warn',
63
- mixed_indent: 'warn',
64
- long_function_call: 'warn',
65
- no_return: 'warn',
63
+ mixed_indent: 'info',
64
+ long_function_call: 'info',
65
+ no_return: 'info',
66
66
  shadow_builtin: 'warn',
67
67
  dynamic_doc: 'warn',
68
- redundant_if: 'warn',
69
- unused_catch_result: 'off',
70
- string_concat_loop: 'off',
68
+ redundant_if: 'info',
69
+ unused_catch_result: 'info',
70
+ string_concat_loop: 'info',
71
71
  if_without_else: 'off',
72
- redundant_list: 'warn',
72
+ redundant_list: 'info',
73
73
  entget_in_loop: 'warn',
74
74
  promise_handler: 'off',
75
75
  module_cycle: 'warn',
@@ -103,7 +103,7 @@ exports.PRESETS = {
103
103
  recursive_call: 'error',
104
104
  variable_shadow: 'error',
105
105
  unused_local_fun: 'error',
106
- multiple_setq: 'off',
106
+ multiple_setq: 'info',
107
107
  redundant_quotes: 'error',
108
108
  trailing_paren: 'error',
109
109
  empty_comment: 'error',
@@ -140,7 +140,7 @@ exports.PRESETS = {
140
140
  nth_usage: 'error',
141
141
  append_single: 'error',
142
142
  setq_multiple: 'error',
143
- function_order: 'warn',
143
+ function_order: 'off',
144
144
  magic_number: 'warn',
145
145
  mixed_indent: 'error',
146
146
  long_function_call: 'error',
package/dist/rules.js CHANGED
@@ -5,7 +5,7 @@ exports.generateRulesMarkdown = generateRulesMarkdown;
5
5
  exports.RULES = [
6
6
  {
7
7
  name: 'append_single',
8
- defaultSeverity: 'warn',
8
+ defaultSeverity: 'info',
9
9
  description: '检测 (append (list ...)) 推荐使用 cons',
10
10
  category: '风格',
11
11
  },
@@ -34,9 +34,9 @@ exports.RULES = [
34
34
  description: '检测 command shell 调用(命令注入风险)',
35
35
  category: '安全',
36
36
  },
37
- { name: 'comment_style', defaultSeverity: 'warn', description: '检测 ; 后缺少空格的注释', category: '风格' },
37
+ { name: 'comment_style', defaultSeverity: 'info', description: '检测 ; 后缺少空格的注释', category: '风格' },
38
38
  { name: 'commented_code', defaultSeverity: 'warn', description: '检测被注释掉的代码', category: '风格' },
39
- { name: 'cond_simplify', defaultSeverity: 'warn', description: '检测可简化为 if 的单分支 cond', category: '风格' },
39
+ { name: 'cond_simplify', defaultSeverity: 'info', description: '检测可简化为 if 的单分支 cond', category: '风格' },
40
40
  {
41
41
  name: 'constant_condition',
42
42
  defaultSeverity: 'warn',
@@ -53,7 +53,7 @@ exports.RULES = [
53
53
  { name: 'duplicate_defun', defaultSeverity: 'warn', description: '检测多次定义的函数名', category: '正确性' },
54
54
  {
55
55
  name: 'double_not',
56
- defaultSeverity: 'warn',
56
+ defaultSeverity: 'info',
57
57
  description: '检测双重 (not (not ...)) 可简化为单个 not',
58
58
  category: '风格',
59
59
  },
@@ -65,7 +65,7 @@ exports.RULES = [
65
65
  description: '检测未检查结果的 vl-catch-all-apply',
66
66
  category: '最佳实践',
67
67
  },
68
- { name: 'empty_comment', defaultSeverity: 'warn', description: '检测空注释行(只有分号没有内容)', category: '风格' },
68
+ { name: 'empty_comment', defaultSeverity: 'info', description: '检测空注释行(只有分号没有内容)', category: '风格' },
69
69
  { name: 'encoding', defaultSeverity: 'error', description: '检查 UTF-8 BOM 和非 UTF-8 编码', category: '编码' },
70
70
  { name: 'eq_usage', defaultSeverity: 'warn', description: '检测 eq 与数字比较', category: '最佳实践' },
71
71
  {
@@ -81,7 +81,7 @@ exports.RULES = [
81
81
  description: '检查函数行数和嵌套深度是否超限',
82
82
  category: '复杂度',
83
83
  },
84
- { name: 'function_order', defaultSeverity: 'off', description: '检测函数定义在使用之后', category: '风格' },
84
+ { name: 'function_order', defaultSeverity: 'info', description: '检测函数定义在使用之后', category: '风格' },
85
85
  { name: 'format_indent', defaultSeverity: 'off', description: '检测代码缩进是否符合格式化规范', category: '风格' },
86
86
  {
87
87
  name: 'identical_branches',
@@ -89,53 +89,53 @@ exports.RULES = [
89
89
  description: '检测 if 中 then 和 else 分支完全相同',
90
90
  category: '正确性',
91
91
  },
92
- { name: 'global_naming', defaultSeverity: 'warn', description: '检测全局变量是否使用 *...* 命名', category: '风格' },
92
+ { name: 'global_naming', defaultSeverity: 'info', description: '检测全局变量是否使用 *...* 命名', category: '风格' },
93
93
  {
94
94
  name: 'lambda_syntax',
95
95
  defaultSeverity: 'off',
96
96
  description: '检测 (function (lambda ...)) 建议使用缩写',
97
97
  category: '风格',
98
98
  },
99
- { name: 'line_length', defaultSeverity: 'warn', description: '检查行长度是否超过限制', category: '风格' },
100
- { name: 'long_function_call', defaultSeverity: 'warn', description: '检测单行参数过多的函数调用', category: '风格' },
99
+ { name: 'line_length', defaultSeverity: 'info', description: '检查行长度是否超过限制', category: '风格' },
100
+ { name: 'long_function_call', defaultSeverity: 'info', description: '检测单行参数过多的函数调用', category: '风格' },
101
101
  {
102
102
  name: 'loop_optimization',
103
- defaultSeverity: 'off',
103
+ defaultSeverity: 'info',
104
104
  description: '检测可优化的 while/assoc 循环',
105
105
  category: '最佳实践',
106
106
  },
107
- { name: 'magic_number', defaultSeverity: 'off', description: '检测硬编码的魔法数字', category: '风格' },
107
+ { name: 'magic_number', defaultSeverity: 'info', description: '检测硬编码的魔法数字', category: '风格' },
108
108
  {
109
109
  name: 'misplaced_else',
110
- defaultSeverity: 'warn',
110
+ defaultSeverity: 'info',
111
111
  description: '检测 (if (not ...) ...) 建议交换分支',
112
112
  category: '风格',
113
113
  },
114
- { name: 'missing_doc', defaultSeverity: 'warn', description: '检测缺少注释说明的函数', category: '风格' },
114
+ { name: 'missing_doc', defaultSeverity: 'info', description: '检测缺少注释说明的函数', category: '风格' },
115
115
  { name: 'missing_export', defaultSeverity: 'warn', description: '检测函数未注册到 @::*modules*', category: '架构' },
116
- { name: 'mixed_indent', defaultSeverity: 'warn', description: '检测缩进中混用 tab 和空格', category: '风格' },
116
+ { name: 'mixed_indent', defaultSeverity: 'info', description: '检测缩进中混用 tab 和空格', category: '风格' },
117
117
  {
118
118
  name: 'module_registration',
119
119
  defaultSeverity: 'off',
120
120
  description: '检测模块文件是否注册到 *modules*',
121
121
  category: '架构',
122
122
  },
123
- { name: 'multiple_setq', defaultSeverity: 'off', description: '检测多个连续 setq 可以合并', category: '风格' },
123
+ { name: 'multiple_setq', defaultSeverity: 'info', description: '检测多个连续 setq 可以合并', category: '风格' },
124
124
  {
125
125
  name: 'namespace_header',
126
126
  defaultSeverity: 'off',
127
127
  description: '检测文件是否包含 (in-package ...) 头',
128
128
  category: '架构',
129
129
  },
130
- { name: 'no_return', defaultSeverity: 'warn', description: '检测没有返回值的函数', category: '最佳实践' },
131
- { name: 'nth_usage', defaultSeverity: 'warn', description: '检测 (nth 0 ...) 推荐使用 car', category: '风格' },
130
+ { name: 'no_return', defaultSeverity: 'info', description: '检测没有返回值的函数', category: '最佳实践' },
131
+ { name: 'nth_usage', defaultSeverity: 'info', description: '检测 (nth 0 ...) 推荐使用 car', category: '风格' },
132
132
  {
133
133
  name: 'open_without_close',
134
134
  defaultSeverity: 'warn',
135
135
  description: '检测 open/close 数量不匹配(资源泄露)',
136
136
  category: '最佳实践',
137
137
  },
138
- { name: 'parameter_naming', defaultSeverity: 'warn', description: '检查参数名是否首字母大写', category: '风格' },
138
+ { name: 'parameter_naming', defaultSeverity: 'info', description: '检查参数名是否首字母大写', category: '风格' },
139
139
  { name: 'parens', defaultSeverity: 'error', description: '检查括号是否匹配(考虑字符串和注释)', category: '语法' },
140
140
  {
141
141
  name: 'quit_exit',
@@ -143,7 +143,7 @@ exports.RULES = [
143
143
  description: '检测 quit/exit 调用(会终止 CAD 进程)',
144
144
  category: '安全',
145
145
  },
146
- { name: 'quote_style', defaultSeverity: 'warn', description: '检测 (quote ...) 建议使用缩写', category: '风格' },
146
+ { name: 'quote_style', defaultSeverity: 'info', description: '检测 (quote ...) 建议使用缩写', category: '风格' },
147
147
  {
148
148
  name: 'quote_vs_function',
149
149
  defaultSeverity: 'warn',
@@ -156,11 +156,11 @@ exports.RULES = [
156
156
  description: '检测函数调用自身(可能无限递归)',
157
157
  category: '正确性',
158
158
  },
159
- { name: 'redundant_if', defaultSeverity: 'warn', description: '检测 when/unless 中冗余 progn(when/unless 已隐含 progn)', category: '风格' },
160
- { name: 'redundant_let', defaultSeverity: 'warn', description: '检测无绑定的 let 建议改用 progn', category: '风格' },
161
- { name: 'redundant_nil_else', defaultSeverity: 'warn', description: '检测 if 中冗余的 nil 分支', category: '风格' },
162
- { name: 'redundant_progn', defaultSeverity: 'warn', description: '检测分支中多余的 progn', category: '风格' },
163
- { name: 'redundant_quotes', defaultSeverity: 'warn', description: "检测冗余双引号(如 ''x)", category: '风格' },
159
+ { name: 'redundant_if', defaultSeverity: 'info', description: '检测 when/unless 中冗余 progn(when/unless 已隐含 progn)', category: '风格' },
160
+ { name: 'redundant_let', defaultSeverity: 'info', description: '检测无绑定的 let 建议改用 progn', category: '风格' },
161
+ { name: 'redundant_nil_else', defaultSeverity: 'info', description: '检测 if 中冗余的 nil 分支', category: '风格' },
162
+ { name: 'redundant_progn', defaultSeverity: 'info', description: '检测分支中多余的 progn', category: '风格' },
163
+ { name: 'redundant_quotes', defaultSeverity: 'info', description: "检测冗余双引号(如 ''x)", category: '风格' },
164
164
  { name: 'redundant_setq', defaultSeverity: 'warn', description: '检测 setq 变量赋值为自身', category: '风格' },
165
165
  {
166
166
  name: 'self_compare',
@@ -171,11 +171,11 @@ exports.RULES = [
171
171
  { name: 'setq_single_arg', defaultSeverity: 'warn', description: '检测 setq 只有变量名缺少值', category: '正确性' },
172
172
  { name: 'setq_multiple', defaultSeverity: 'warn', description: '检测多个连续 setq 可以合并', category: '风格' },
173
173
  { name: 'shadow_builtin', defaultSeverity: 'warn', description: '检测覆盖内置函数的 defun', category: '最佳实践' },
174
- { name: 'single_arg_and_or', defaultSeverity: 'warn', description: '检测单参数 and/or 建议简化', category: '风格' },
174
+ { name: 'single_arg_and_or', defaultSeverity: 'info', description: '检测单参数 and/or 建议简化', category: '风格' },
175
175
  { name: 'startapp', defaultSeverity: 'warn', description: '检测 startapp 调用(启动外部程序)', category: '安全' },
176
176
  {
177
177
  name: 'strcat_usage',
178
- defaultSeverity: 'warn',
178
+ defaultSeverity: 'info',
179
179
  description: '检测是否使用 + 而非 strcat 拼接字符串',
180
180
  category: '最佳实践',
181
181
  },
@@ -186,8 +186,8 @@ exports.RULES = [
186
186
  category: '安全',
187
187
  },
188
188
  { name: 'trailing_paren', defaultSeverity: 'warn', description: '检测多余闭合括号', category: '语法' },
189
- { name: 'trailing_whitespace', defaultSeverity: 'warn', description: '检测行尾多余空格', category: '风格' },
190
- { name: 'type_check', defaultSeverity: 'off', description: '检测 getvar 结果未做类型检查', category: '最佳实践' },
189
+ { name: 'trailing_whitespace', defaultSeverity: 'info', description: '检测行尾多余空格', category: '风格' },
190
+ { name: 'type_check', defaultSeverity: 'info', description: '检测 getvar 结果未做类型检查', category: '最佳实践' },
191
191
  {
192
192
  name: 'undeclared_setq',
193
193
  defaultSeverity: 'warn',
@@ -228,12 +228,12 @@ exports.RULES = [
228
228
  description: '检测 vlax-* 使用前未调用 vl-load-com',
229
229
  category: '最佳实践',
230
230
  },
231
- { name: 'unused_catch_result', defaultSeverity: 'off', description: '检测 vl-catch-all-apply 结果被当布尔值用', category: '正确性' },
232
- { name: 'string_concat_loop', defaultSeverity: 'off', description: '检测循环内字符串拼接', category: '性能' },
233
- { name: 'if_without_else', defaultSeverity: 'off', description: '检测 if 无 else 分支', category: '风格' },
234
- { name: 'redundant_list', defaultSeverity: 'warn', description: '检测 (list) 等价于 nil', category: '风格' },
231
+ { name: 'unused_catch_result', defaultSeverity: 'info', description: '检测 vl-catch-all-apply 结果被当布尔值用', category: '正确性' },
232
+ { name: 'string_concat_loop', defaultSeverity: 'info', description: '检测循环内字符串拼接', category: '性能' },
233
+ { name: 'if_without_else', defaultSeverity: 'info', description: '检测 if 无 else 分支', category: '风格' },
234
+ { name: 'redundant_list', defaultSeverity: 'info', description: '检测 (list) 等价于 nil', category: '风格' },
235
235
  { name: 'entget_in_loop', defaultSeverity: 'warn', description: '检测循环内 entget', category: '性能' },
236
- { name: 'promise_handler', defaultSeverity: 'off', description: '检测 vlax-invoke 缺少回调处理器', category: '最佳实践' },
236
+ { name: 'promise_handler', defaultSeverity: 'info', description: '检测 vlax-invoke 缺少回调处理器', category: '最佳实践' },
237
237
  { name: 'module_cycle', defaultSeverity: 'warn', description: '检测模块循环依赖', category: '架构' },
238
238
  { name: 'arg_count_project', defaultSeverity: 'warn', description: '跨文件检查函数参数数量', category: '正确性' },
239
239
  { name: 'builtin_arg_count', defaultSeverity: 'error', description: '检查 AutoLISP 内置函数调用参数个数是否匹配', category: '正确性' },
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type Severity = 'off' | 'warn' | 'error';
1
+ export type Severity = 'off' | 'info' | 'warn' | 'error';
2
2
  export interface Fix {
3
3
  range: [number, number];
4
4
  replacement: string;
@@ -72,5 +72,6 @@ export interface FormattedResult {
72
72
  issues: Issue[];
73
73
  error_count: number;
74
74
  warning_count: number;
75
+ info_count: number;
75
76
  }
76
77
  //# sourceMappingURL=types.d.ts.map
package/dist/validate.js CHANGED
@@ -86,7 +86,7 @@ const VALID_RULES = [
86
86
  'module_cycle',
87
87
  'arg_count_project',
88
88
  ];
89
- const VALID_SEVERITIES = ['off', 'warn', 'error'];
89
+ const VALID_SEVERITIES = ['off', 'info', 'warn', 'error'];
90
90
  function validateConfig(config) {
91
91
  const errors = [];
92
92
  if (config.locale && config.locale !== 'zh' && config.locale !== 'en') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlisp/lint",
3
- "version": "0.1.30",
3
+ "version": "0.2.1",
4
4
  "description": "AutoLISP static analysis tool — parens, security, conventions, SBCL syntax validation",
5
5
  "keywords": [
6
6
  "CAD",