@atlisp/lint 0.1.0 → 0.1.2
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/README.md +35 -1
- package/atlisp-lint.default.json +19 -0
- package/dist/atlisp-lint.default.json +19 -0
- package/dist/cache.d.ts +4 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +74 -0
- package/dist/cache.js.map +1 -0
- package/dist/checks/arg-count.d.ts +3 -0
- package/dist/checks/arg-count.d.ts.map +1 -0
- package/dist/checks/arg-count.js +120 -0
- package/dist/checks/arg-count.js.map +1 -0
- package/dist/checks/cond-simplify.d.ts +3 -0
- package/dist/checks/cond-simplify.d.ts.map +1 -0
- package/dist/checks/cond-simplify.js +42 -0
- package/dist/checks/cond-simplify.js.map +1 -0
- package/dist/checks/dangerous-calls.d.ts.map +1 -1
- package/dist/checks/dangerous-calls.js +9 -7
- package/dist/checks/dangerous-calls.js.map +1 -1
- package/dist/checks/error-handling.d.ts +3 -0
- package/dist/checks/error-handling.d.ts.map +1 -0
- package/dist/checks/error-handling.js +53 -0
- package/dist/checks/error-handling.js.map +1 -0
- package/dist/checks/extra-parens.d.ts +3 -0
- package/dist/checks/extra-parens.d.ts.map +1 -0
- package/dist/checks/extra-parens.js +42 -0
- package/dist/checks/extra-parens.js.map +1 -0
- package/dist/checks/function-complexity.d.ts +3 -0
- package/dist/checks/function-complexity.d.ts.map +1 -0
- package/dist/checks/function-complexity.js +57 -0
- package/dist/checks/function-complexity.js.map +1 -0
- package/dist/checks/global-naming.d.ts +3 -0
- package/dist/checks/global-naming.d.ts.map +1 -0
- package/dist/checks/global-naming.js +51 -0
- package/dist/checks/global-naming.js.map +1 -0
- package/dist/checks/line-length.d.ts +3 -0
- package/dist/checks/line-length.d.ts.map +1 -0
- package/dist/checks/line-length.js +19 -0
- package/dist/checks/line-length.js.map +1 -0
- package/dist/checks/missing-doc.d.ts +3 -0
- package/dist/checks/missing-doc.d.ts.map +1 -0
- package/dist/checks/missing-doc.js +40 -0
- package/dist/checks/missing-doc.js.map +1 -0
- package/dist/checks/parameter-naming.d.ts +3 -0
- package/dist/checks/parameter-naming.d.ts.map +1 -0
- package/dist/checks/parameter-naming.js +29 -0
- package/dist/checks/parameter-naming.js.map +1 -0
- package/dist/checks/strcat-usage.d.ts +3 -0
- package/dist/checks/strcat-usage.d.ts.map +1 -0
- package/dist/checks/strcat-usage.js +22 -0
- package/dist/checks/strcat-usage.js.map +1 -0
- package/dist/checks/unused-variable.d.ts +3 -0
- package/dist/checks/unused-variable.d.ts.map +1 -0
- package/dist/checks/unused-variable.js +50 -0
- package/dist/checks/unused-variable.js.map +1 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +35 -0
- package/dist/config.js.map +1 -1
- package/dist/disable.d.ts +4 -0
- package/dist/disable.d.ts.map +1 -0
- package/dist/disable.js +31 -0
- package/dist/disable.js.map +1 -0
- package/dist/formatters.d.ts +2 -1
- package/dist/formatters.d.ts.map +1 -1
- package/dist/formatters.js +105 -7
- package/dist/formatters.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +91 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/lint-sbcl.lisp +54 -19
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +34 -0
- package/dist/locale.js.map +1 -1
- package/dist/rules.d.ts +9 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +39 -0
- package/dist/rules.js.map +1 -0
- package/dist/runner.d.ts +2 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +117 -41
- package/dist/runner.js.map +1 -1
- package/dist/sbcl.d.ts.map +1 -1
- package/dist/sbcl.js +35 -17
- package/dist/sbcl.js.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +8 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +55 -0
- package/dist/validate.js.map +1 -0
- package/dist/watch.d.ts +9 -0
- package/dist/watch.d.ts.map +1 -0
- package/dist/watch.js +109 -0
- package/dist/watch.js.map +1 -0
- package/dist/worker.d.ts +2 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +72 -0
- package/dist/worker.js.map +1 -0
- package/lib/lint-sbcl.lisp +54 -19
- package/package.json +11 -2
package/dist/worker.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const worker_threads_1 = require("worker_threads");
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const locale_1 = require("./locale");
|
|
6
|
+
const disable_1 = require("./disable");
|
|
7
|
+
const encoding_1 = require("./checks/encoding");
|
|
8
|
+
const parens_1 = require("./checks/parens");
|
|
9
|
+
const cl_syntax_1 = require("./checks/cl-syntax");
|
|
10
|
+
const dangerous_calls_1 = require("./checks/dangerous-calls");
|
|
11
|
+
const vlax_1 = require("./checks/vlax");
|
|
12
|
+
const token_in_url_1 = require("./checks/token-in-url");
|
|
13
|
+
const open_close_1 = require("./checks/open-close");
|
|
14
|
+
const bare_names_1 = require("./checks/bare-names");
|
|
15
|
+
const module_reg_1 = require("./checks/module-reg");
|
|
16
|
+
const namespace_header_1 = require("./checks/namespace-header");
|
|
17
|
+
const line_length_1 = require("./checks/line-length");
|
|
18
|
+
const function_complexity_1 = require("./checks/function-complexity");
|
|
19
|
+
const parameter_naming_1 = require("./checks/parameter-naming");
|
|
20
|
+
const unused_variable_1 = require("./checks/unused-variable");
|
|
21
|
+
const missing_doc_1 = require("./checks/missing-doc");
|
|
22
|
+
const trailing_ws_1 = require("./checks/trailing-ws");
|
|
23
|
+
function runChecks(content, file, config) {
|
|
24
|
+
const issues = [];
|
|
25
|
+
const disableMap = (0, disable_1.parseDisableComments)(content);
|
|
26
|
+
function addIfEnabled(rule, fn) {
|
|
27
|
+
const results = fn();
|
|
28
|
+
for (const r of results) {
|
|
29
|
+
if (!(0, disable_1.isDisabled)(r.rule, r.line, disableMap)) {
|
|
30
|
+
issues.push(r);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
addIfEnabled('encoding', () => (0, encoding_1.checkEncoding)(content, file));
|
|
35
|
+
addIfEnabled('parens', () => (0, parens_1.checkParens)(content, file));
|
|
36
|
+
addIfEnabled('cl_syntax', () => (0, cl_syntax_1.checkClSyntax)(content, file, config.cl_syntax.keywords));
|
|
37
|
+
addIfEnabled('quit_exit', () => (0, dangerous_calls_1.checkDangerousCalls)(content, file, config.dangerous_calls));
|
|
38
|
+
addIfEnabled('vlax_without_loading', () => (0, vlax_1.checkVlaxWithoutLoading)(content, file));
|
|
39
|
+
addIfEnabled('token_in_url', () => (0, token_in_url_1.checkTokenInUrl)(content, file));
|
|
40
|
+
addIfEnabled('open_without_close', () => (0, open_close_1.checkOpenWithoutClose)(content, file));
|
|
41
|
+
addIfEnabled('bare_function_names', () => (0, bare_names_1.checkBareFunctionNames)(content, file, config.bare_function_names.allowlist, config.bare_function_names.namespace_pattern));
|
|
42
|
+
addIfEnabled('module_registration', () => (0, module_reg_1.checkModuleRegistration)(content, file, file, config.module_registration));
|
|
43
|
+
addIfEnabled('namespace_header', () => (0, namespace_header_1.checkNamespaceHeader)(content, file, config.namespace_header));
|
|
44
|
+
addIfEnabled('line_length', () => (0, line_length_1.checkLineLength)(content, file, config.line_length.max, config.line_length.tab_width));
|
|
45
|
+
addIfEnabled('function_complexity', () => (0, function_complexity_1.checkFunctionComplexity)(content, file, config.function_complexity.max_lines, config.function_complexity.max_nesting));
|
|
46
|
+
addIfEnabled('parameter_naming', () => (0, parameter_naming_1.checkParameterNaming)(content, file));
|
|
47
|
+
addIfEnabled('unused_variable', () => (0, unused_variable_1.checkUnusedVariable)(content, file));
|
|
48
|
+
addIfEnabled('missing_doc', () => (0, missing_doc_1.checkMissingDoc)(content, file));
|
|
49
|
+
addIfEnabled('trailing_whitespace', () => (0, trailing_ws_1.checkTrailingWhitespace)(content, file));
|
|
50
|
+
return issues;
|
|
51
|
+
}
|
|
52
|
+
if (worker_threads_1.parentPort && worker_threads_1.workerData) {
|
|
53
|
+
const input = worker_threads_1.workerData;
|
|
54
|
+
(0, locale_1.setLocale)(input.config.locale || 'zh');
|
|
55
|
+
try {
|
|
56
|
+
const content = (0, fs_1.readFileSync)(input.filepath, 'utf-8');
|
|
57
|
+
const issues = runChecks(content, input.relPath, input.config);
|
|
58
|
+
const output = { filepath: input.filepath, issues };
|
|
59
|
+
worker_threads_1.parentPort.postMessage(output);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
const output = {
|
|
63
|
+
filepath: input.filepath,
|
|
64
|
+
issues: [{
|
|
65
|
+
file: input.relPath, line: 1, severity: 'error', rule: 'read',
|
|
66
|
+
message: 'Cannot read file',
|
|
67
|
+
}],
|
|
68
|
+
};
|
|
69
|
+
worker_threads_1.parentPort.postMessage(output);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":";;AAAA,mDAAwD;AACxD,2BAAkC;AAElC,qCAAqC;AACrC,uCAA6D;AAC7D,gDAAkD;AAClD,4CAA8C;AAC9C,kDAAmD;AACnD,8DAA+D;AAC/D,wCAAwD;AACxD,wDAAwD;AACxD,oDAA4D;AAC5D,oDAA6D;AAC7D,oDAA8D;AAC9D,gEAAiE;AACjE,sDAAuD;AACvD,sEAAuE;AACvE,gEAAiE;AACjE,8DAA+D;AAC/D,sDAAuD;AACvD,sDAA+D;AAa/D,SAAS,SAAS,CAAC,OAAe,EAAE,IAAY,EAAE,MAAkB;IAClE,MAAM,MAAM,GAA8B,EAAE,CAAC;IAC7C,MAAM,UAAU,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,CAAA;IAEhD,SAAS,YAAY,CAAC,I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,CAAC;IACxC,IAAA,kBAAS,EAAC,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;IAEvC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,iBAAY,EAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAiB,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAClE,2BAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,MAAM,GAAiB;YAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,CAAC;oBACP,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM;oBAC7D,OAAO,EAAE,kBAAkB;iBAC5B,CAAC;SACH,CAAC;QACF,2BAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
|
package/lib/lint-sbcl.lisp
CHANGED
|
@@ -1,14 +1,49 @@
|
|
|
1
1
|
;; @lisp SBCL Lint — syntax validation via SBCL
|
|
2
|
-
;; Usage: sbcl --script lint-sbcl.lisp <src-dir> <stub-packages.json> <walk-exclude-json> <defmacro-allow-files-json>
|
|
2
|
+
;; Usage: sbcl --script lint-sbcl.lisp <src-dir> <stub-packages.json> <walk-exclude-json> <defmacro-allow-files-json> <locale>
|
|
3
3
|
|
|
4
4
|
(require :uiop)
|
|
5
5
|
|
|
6
6
|
(defparameter *errors* 0)
|
|
7
7
|
(defparameter *warnings* 0)
|
|
8
8
|
(defparameter *checked* 0)
|
|
9
|
+
(defparameter *locale* "zh")
|
|
10
|
+
|
|
11
|
+
;; ── i18n ──────────────────────────────────────────────────────────────
|
|
12
|
+
(defun i18n (key)
|
|
13
|
+
(cdr (assoc key
|
|
14
|
+
(if (string= *locale* "zh")
|
|
15
|
+
'((:not-found . "not found symbol")
|
|
16
|
+
(:syntax-error . "syntax error")
|
|
17
|
+
(:vec-syntax . "#( vector syntax")
|
|
18
|
+
(:char-syntax . "# backslash char literal")
|
|
19
|
+
(:eval-syntax . "#. read-time eval")
|
|
20
|
+
(:defmacro . "defmacro")
|
|
21
|
+
(:trailing-ws . "trailing whitespace")
|
|
22
|
+
(:ok . "OK")
|
|
23
|
+
(:fail . "FAIL")
|
|
24
|
+
(:header . " @lisp SBCL Lint")
|
|
25
|
+
(:source . " Source")
|
|
26
|
+
(:found . " Found ~d .lsp files")
|
|
27
|
+
(:scanned . " Scanned")
|
|
28
|
+
(:errors . " Errors")
|
|
29
|
+
(:warnings . " Warnings"))
|
|
30
|
+
'((:not-found . "not found symbol")
|
|
31
|
+
(:syntax-error . "syntax error")
|
|
32
|
+
(:vec-syntax . "#( vector syntax")
|
|
33
|
+
(:char-syntax . "# backslash char literal")
|
|
34
|
+
(:eval-syntax . "#. read-time eval")
|
|
35
|
+
(:defmacro . "defmacro")
|
|
36
|
+
(:trailing-ws . "trailing whitespace")
|
|
37
|
+
(:ok . "OK")
|
|
38
|
+
(:fail . "FAIL")
|
|
39
|
+
(:header . " @lisp SBCL Lint")
|
|
40
|
+
(:source . " Source")
|
|
41
|
+
(:found . " Found ~d .lsp files")
|
|
42
|
+
(:scanned . " Scanned")
|
|
43
|
+
(:errors . " Errors")
|
|
44
|
+
(:warnings . " Warnings"))))))
|
|
9
45
|
|
|
10
46
|
;; ── Stub packages from external file ──────────────────────────────────
|
|
11
|
-
;; File format: alist ((name use*) ...) — valid Lisp data
|
|
12
47
|
(defun load-stub-packages (file-path)
|
|
13
48
|
(flet ((ensure-pkg (name &optional use-list)
|
|
14
49
|
(unless (find-package name)
|
|
@@ -52,11 +87,10 @@
|
|
|
52
87
|
(let ((msg (princ-to-string e)))
|
|
53
88
|
(cond
|
|
54
89
|
((search "not found" msg)
|
|
55
|
-
(format t "~% [NOTE] ~a: ~a~%" rel
|
|
56
|
-
(subseq msg 0 (min 80 (length msg))))
|
|
90
|
+
(format t "~% [NOTE] ~a: ~a~%" rel (i18n :not-found))
|
|
57
91
|
(incf *warnings*))
|
|
58
92
|
(t
|
|
59
|
-
(format t "
|
|
93
|
+
(format t "~a~% [ERROR] ~a: ~a~%" (i18n :fail) rel (i18n :syntax-error))
|
|
60
94
|
(incf *errors*)
|
|
61
95
|
(return-from check-file))))))
|
|
62
96
|
;; Trailing whitespace
|
|
@@ -67,7 +101,7 @@
|
|
|
67
101
|
when (and (> (length line) 0)
|
|
68
102
|
(find (char line (1- (length line))) '(#\Space #\Tab)))
|
|
69
103
|
do (progn
|
|
70
|
-
(format t "~% [WARN] ~a line ~d:
|
|
104
|
+
(format t "~% [WARN] ~a line ~d: ~a~%" rel lineno (i18n :trailing-ws))
|
|
71
105
|
(incf *warnings*))))
|
|
72
106
|
;; CL-ism checks: raw content scan
|
|
73
107
|
(with-open-file (s path :direction :input)
|
|
@@ -75,19 +109,19 @@
|
|
|
75
109
|
(file-position s 0)
|
|
76
110
|
(read-sequence content s)
|
|
77
111
|
(when (search "#(" content)
|
|
78
|
-
(format t "~% [WARN] ~a:
|
|
112
|
+
(format t "~% [WARN] ~a: ~a~%" rel (i18n :vec-syntax))
|
|
79
113
|
(incf *warnings*))
|
|
80
114
|
(when (search "#\\" content)
|
|
81
|
-
(format t "~% [WARN] ~a:
|
|
115
|
+
(format t "~% [WARN] ~a: ~a~%" rel (i18n :char-syntax))
|
|
82
116
|
(incf *warnings*))
|
|
83
117
|
(when (search "#." content)
|
|
84
|
-
(format t "~% [WARN] ~a:
|
|
118
|
+
(format t "~% [WARN] ~a: ~a~%" rel (i18n :eval-syntax))
|
|
85
119
|
(incf *warnings*))
|
|
86
120
|
(when (and (search "defmacro" content)
|
|
87
121
|
(not (some (lambda (s) (search s fullname)) defmacro-allow-files)))
|
|
88
|
-
(format t "~% [WARN] ~a:
|
|
122
|
+
(format t "~% [WARN] ~a: ~a~%" rel (i18n :defmacro))
|
|
89
123
|
(incf *warnings*))))
|
|
90
|
-
(format t "
|
|
124
|
+
(format t "~a~%" (i18n :ok))))
|
|
91
125
|
|
|
92
126
|
;; ── Main ──────────────────────────────────────────────────────────────
|
|
93
127
|
(defun main ()
|
|
@@ -99,25 +133,26 @@
|
|
|
99
133
|
'(".vscode" "test" "experiment" "tools" ".git")))
|
|
100
134
|
(defmacro-allow (if (fourth args)
|
|
101
135
|
(read-from-string (fourth args))
|
|
102
|
-
'("compat-cl")))
|
|
103
|
-
|
|
136
|
+
'("compat-cl")))
|
|
137
|
+
(locale (fifth args)))
|
|
138
|
+
(when locale (setf *locale* locale))
|
|
104
139
|
(load-stub-packages stub-file)
|
|
105
140
|
|
|
106
141
|
(format t "~%==================================================~%")
|
|
107
|
-
(format t "
|
|
108
|
-
(format t "
|
|
142
|
+
(format t "~a~%" (i18n :header))
|
|
143
|
+
(format t "~a: ~a~%" (i18n :source) (namestring (pathname src-dir)))
|
|
109
144
|
(format t "==================================================~%~%")
|
|
110
145
|
(setf *errors* 0 *warnings* 0 *checked* 0)
|
|
111
146
|
|
|
112
147
|
(let ((files (walk-tree src-dir walk-exclude)))
|
|
113
|
-
(format t "
|
|
148
|
+
(format t "~a~%~%" (format nil (i18n :found) (length files)))
|
|
114
149
|
(dolist (f files)
|
|
115
150
|
(check-file f src-dir defmacro-allow)))
|
|
116
151
|
|
|
117
152
|
(format t "~%==================================================~%")
|
|
118
|
-
(format t "
|
|
119
|
-
(format t "
|
|
120
|
-
(format t "
|
|
153
|
+
(format t "~a: ~d~%" (i18n :scanned) *checked*)
|
|
154
|
+
(format t "~a: ~d~%" (i18n :errors) *errors*)
|
|
155
|
+
(format t "~a: ~d~%" (i18n :warnings) *warnings*)
|
|
121
156
|
(format t "==================================================~%~%")
|
|
122
157
|
(if (> *errors* 0)
|
|
123
158
|
(uiop:quit 1)
|
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlisp/lint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "AutoLISP static analysis tool — parens, security, conventions, SBCL syntax validation",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"CAD",
|
|
7
|
+
"autolisp",
|
|
8
|
+
"atlisp",
|
|
9
|
+
"lint",
|
|
10
|
+
"autocad",
|
|
11
|
+
"zwcad",
|
|
12
|
+
"gstarcad",
|
|
13
|
+
"bricscad"
|
|
14
|
+
],
|
|
6
15
|
"bin": {
|
|
7
16
|
"atlisp-lint": "./bin/atlisp-lint"
|
|
8
17
|
},
|