@produtype/core 0.93.0 → 0.94.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.
@@ -185,6 +185,25 @@ function layoutPartOf(file) {
185
185
  const root = JVM_MAIN_SOURCE_ROOT.exec(file);
186
186
  return root ? file.slice(0, root.index + root[0].length) : file;
187
187
  }
188
+ /**
189
+ * Go names its tests by file, never by directory.
190
+ *
191
+ * `_test.go` is the suffix the toolchain compiles separately; a directory called
192
+ * `mock`, `testing` or `fixtures` is just a package. testify's own `mock/mock.go` —
193
+ * half of what that library is for — was removed by the rule that drops `mocks/`, and
194
+ * the analyzer saw 38 of its Go files with the two biggest missing.
195
+ *
196
+ * One directory convention is left here, and it is the toolchain's: a directory whose
197
+ * name begins with `_` or `.` is skipped when building, which is why testify keeps
198
+ * `_codegen` and `_readme-gofmt` under those names.
199
+ *
200
+ * `vendor/` and `testdata/` are not repeated: the file scanner never hands them over
201
+ * in the first place. Both were written here and both survived being deleted in a
202
+ * mutation run, which is how the duplication came to light.
203
+ */
204
+ function isGoToolchainExclusion(file) {
205
+ return /(^|\/)[_.][^/]+\//.test(file);
206
+ }
188
207
  function isTestOrExamplePath(file) {
189
208
  // `__mocks__` was missing, and a mock is the most misleading file in a repository:
190
209
  // `application_fee_percent: null` inside a Stripe fixture made an open-source CRM read
@@ -192,6 +211,12 @@ function isTestOrExamplePath(file) {
192
211
  // `fixtures` was listed and `fixture` was not, so `extra/fixture/authsources.php`
193
212
  // made PHP one of the languages of an Elixir analytics product — and of cal.com,
194
213
  // which is TypeScript.
214
+ /**
215
+ * A Go file answers to Go's conventions and to none of the directory rules below:
216
+ * every one of those names is a package name there.
217
+ */
218
+ if (/\.go$/.test(file))
219
+ return isGoToolchainExclusion(file) || /_test\.go$/.test(file);
195
220
  const layout = layoutPartOf(file);
196
221
  return /(^|\/)(__tests__|__mocks__|mocks?|tests?|test-data|fixtures?|frontend-example)(\/|$)/i.test(layout)
197
222
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@produtype/core",
3
- "version": "0.93.0",
3
+ "version": "0.94.0",
4
4
  "description": "Deterministic CLI and library that analyzes a web application repository and reports how far it is from production-ready for the kind of product it is meant to be.",
5
5
  "license": "MIT",
6
6
  "bin": {