@systemfsoftware/oxlint-plugin-test-discipline 4.0.1 → 5.0.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/CHANGELOG.md +14 -0
- package/dist/index.mjs +7 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @systemfsoftware/oxlint-plugin-test-discipline
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Rules recognize effect 4.0.0 module paths: `effect/Arbitrary` (and the root `Arbitrary` name), `effect/process/ChildProcessSpawner`, and the `effect/encoding` codecs. A module is judged the same whether it is imported from `effect`, from an `effect/<area>` barrel, or by its own subpath. `schema-file-imports-pure-modules-only` admits `Base64`, `Base64Url`, `Hex` and `EncodingError` from `effect/encoding` in place of the removed `Encoding` module.
|
|
8
|
+
|
|
9
|
+
- Require `effect` `^4` (stable 4.0.0). Release candidates are no longer supported: imports follow 4.0.0's module layout (`effect/http`, `effect/rpc`, `effect/http-api`, `effect/cluster`, `effect/process`, `effect/socket`, `effect/persistence`, `effect/reactivity`, `effect/encoding`, `effect/Arbitrary`), which does not exist in any 4.0.0 RC.
|
|
10
|
+
|
|
11
|
+
## 4.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- The `contract` test suffix is retired. `test-suffix-outside-src` now reports a test file named with the `contract` suffix, and the behaviour-test rules (`behaviour-test-requires-gherkin`, `behaviour-one-feature-per-file`, `behaviour-exercises-use-case`, `no-pseudo-gherkin-unit-tests`) apply to the `integration` suffix alone. Rename a suite that drives a real medium to the `integration` suffix.
|
|
16
|
+
|
|
3
17
|
## 4.0.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.mjs
CHANGED
|
@@ -81,6 +81,7 @@ const SANCTIONED_TEST_DIRS = /* @__PURE__ */ new Set(["tests"]);
|
|
|
81
81
|
const NESTED_TEST_DIR = "__tests__";
|
|
82
82
|
const TEST_TREE_DIRS = /* @__PURE__ */ new Set([...SANCTIONED_TEST_DIRS, NESTED_TEST_DIR]);
|
|
83
83
|
const PROPERTY_SUFFIX = ".property.test.ts";
|
|
84
|
+
const INTEGRATION_SUFFIX = ".integration.test.ts";
|
|
84
85
|
const DIFFERENTIAL_SUFFIX = ".differential.test.ts";
|
|
85
86
|
/**
|
|
86
87
|
* Forbidden outright. A schema's laws are generated, so a hand-written
|
|
@@ -152,7 +153,7 @@ const isInTestsImportScope = (filename) => {
|
|
|
152
153
|
};
|
|
153
154
|
const isInConfiguredTestDir = (filename, dirs) => directoriesOf(filename).some((segment) => dirs.includes(segment));
|
|
154
155
|
const isTestFile = (basename) => TEST_BASENAME.test(basename);
|
|
155
|
-
const isBehaviourBasename = (basename) => basename.endsWith(
|
|
156
|
+
const isBehaviourBasename = (basename) => basename.endsWith(INTEGRATION_SUFFIX);
|
|
156
157
|
const CELL_SUFFIX = /\.([^.]+)\.[cm]?tsx?$/;
|
|
157
158
|
const cellOf = (basename) => CELL_SUFFIX.exec(basename)?.[1];
|
|
158
159
|
//#endregion
|
|
@@ -1369,7 +1370,7 @@ const IO_SPECIFIERS = {
|
|
|
1369
1370
|
"node:https": true,
|
|
1370
1371
|
"node:dns": true,
|
|
1371
1372
|
"effect/FileSystem": true,
|
|
1372
|
-
"effect/
|
|
1373
|
+
"effect/process/ChildProcessSpawner": true,
|
|
1373
1374
|
"@effect/platform/FileSystem": true,
|
|
1374
1375
|
"@effect/platform/CommandExecutor": true,
|
|
1375
1376
|
"@effect/platform-node": true,
|
|
@@ -2187,7 +2188,7 @@ const dynamicEdgeOf = (declarator, init, name) => {
|
|
|
2187
2188
|
};
|
|
2188
2189
|
const vocabularyOf = (edge) => {
|
|
2189
2190
|
if (SCHEMA_SOURCE_PATTERN.test(edge.source)) return "schema";
|
|
2190
|
-
if (edge.source
|
|
2191
|
+
if (edge.source === "effect/Arbitrary") return "schema";
|
|
2191
2192
|
if (edge.source === "effect" && edge.imported !== null) {
|
|
2192
2193
|
if (SCHEMA_NAMESPACE_NAMES[edge.imported] === true) return "schema";
|
|
2193
2194
|
if (FASTCHECK_NAMESPACE_NAMES[edge.imported] === true) return "handBuilt";
|
|
@@ -2219,7 +2220,7 @@ var Provenance = class {
|
|
|
2219
2220
|
if (resolveLocal$1(name, node, this.getScope).kind !== "import") return false;
|
|
2220
2221
|
const edge = this.imports.get(name);
|
|
2221
2222
|
if (edge === void 0) return false;
|
|
2222
|
-
if (edge.source
|
|
2223
|
+
if (edge.source === "effect/Arbitrary") return true;
|
|
2223
2224
|
return edge.source === "effect" && edge.imported === "Arbitrary";
|
|
2224
2225
|
}
|
|
2225
2226
|
classifyCall(name, node) {
|
|
@@ -3105,9 +3106,9 @@ const testFileOutsideTestsDir = defineRule({
|
|
|
3105
3106
|
});
|
|
3106
3107
|
//#endregion
|
|
3107
3108
|
//#region src/rules/test-suffix-outside-src.config.ts
|
|
3108
|
-
const UNSANCTIONED_SUFFIX_EXPECTED = "*.integration.test.ts, *.
|
|
3109
|
+
const UNSANCTIONED_SUFFIX_EXPECTED = "*.integration.test.ts, *.differential.test.ts, *.trace.test.ts, or *.conformance.test.ts";
|
|
3109
3110
|
const UNSANCTIONED_SUFFIX_ACTUAL = "another test suffix outside src/";
|
|
3110
|
-
const UNSANCTIONED_SUFFIX_FIX = "public surface
|
|
3111
|
+
const UNSANCTIONED_SUFFIX_FIX = "public surface or real medium -> *.integration.test.ts; parity -> *.differential.test.ts; span graph -> *.trace.test.ts; concurrent or stateful behaviour -> *.conformance.test.ts; pure-cell property -> in-source; restated literal -> delete";
|
|
3111
3112
|
//#endregion
|
|
3112
3113
|
//#region src/rules/test-suffix-outside-src.ts
|
|
3113
3114
|
const testSuffixOutsideSrc = defineRule({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/oxlint-plugin-test-discipline",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@systemfsoftware/vitest-config": "^0.1.0",
|
|
57
57
|
"@types/node": "^26",
|
|
58
58
|
"@vitest/coverage-v8": "^5",
|
|
59
|
-
"effect": "4
|
|
59
|
+
"effect": "^4",
|
|
60
60
|
"fast-check": "^4",
|
|
61
61
|
"oxlint": "~1.82.0",
|
|
62
62
|
"rimraf": "^6.1.3",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"vitest": "^5"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"effect": "4
|
|
68
|
+
"effect": "^4",
|
|
69
69
|
"typescript": ">=5.0.0"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|