objectionary/wpa
GitHub: objectionary/wpa
专为 EO 语言设计的全程序静态分析框架,通过跨文件联合检查 XMIR 中间表示来发现单文件 Lint 无法捕获的代码缺陷。
Stars: 4 | Forks: 3
# EO 的全程序分析器
[](https://www.elegantobjects.org)
[](https://www.jetbrains.com/idea/)
[](https://github.com/objectionary/wpa/actions/workflows/mvn.yml)
[](https://www.0pdd.com/p?name=objectionary/wpa)
[](https://maven-badges.herokuapp.com/maven-central/org.eolang/wpa)
[](https://www.javadoc.io/doc/org.eolang/wpa)
[](https://github.com/objectionary/wpa/blob/master/LICENSE.txt)
这个 Java 包是一组全程序分析器
(也称为 WPA lints),专为 [XMIR] 设计——[EO] 对象的
一种中间表示。WPA lints 会将一组 XMIR 文件放在一起进行分析,
而不是每次只分析一个文件。
单文件 lints 位于一个单独的包中,
[`org.eolang:lints`](https://github.com/objectionary/lints),
本库正是构建于该包之上。
将其添加到您的项目中:
```
org.eolang
wpa
```
然后,使用 `Program` 类对 XMIR 文件运行全程序分析:
```
import java.nio.file.Paths;
import org.eolang.lints.Program;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
final class Foo {
@Test
void testProgram() {
Assertions.assertTrue(
new Program(
Paths.get("xmir-files")
).defects().isEmpty()
);
}
}
```
您可以借助 XMIR 源文件中的 `+unlint` 元信息来禁用任何特定的 linter。
## 本库的设计
该库被设计为一组 `Lint
标签:EO语言, JS文件枚举, Linter, pptx, XMIR, 中间表示, 代码分析, 代码规范, 全程序分析, 凭证管理, 域名枚举, 数据管道, 编程语言, 编译器插件, 缺陷检测, 软件工程, 错误基检测, 静态代码分析