@veda-hq/pariksha 0.5.12 → 0.5.13

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 CHANGED
@@ -4,8 +4,8 @@
4
4
  test-quality ratchets. Part of [Veda](https://github.com/veda-hq/veda).
5
5
 
6
6
  ```sh
7
- npx @veda-hq/pariksha@0.5.12 <check> [flags]
8
- npx @veda-hq/pariksha@0.5.12 --version
7
+ npx @veda-hq/pariksha@0.5.13 <check> [flags]
8
+ npx @veda-hq/pariksha@0.5.13 --version
9
9
  ```
10
10
 
11
11
  Every check exits 0 when the repository passes, 1 when it refuses something
@@ -177,7 +177,11 @@ export const runnablePatterns = (prefixes, extensions, bin) => {
177
177
  const alternatives = [...prefixes].sort((a, b) => b.length - a.length).map((p) => `${folder(p)}\\/`);
178
178
  const patterns = [new RegExp(`(?<![\\w./-])((?:\\.\\.?\\/)*(?:${alternatives.join('|')})[\\w./-]*[\\w-]\\.(?:${extensions.map(escape).join('|')}))(?![\\w])`, 'g')];
179
179
  if (bin !== undefined) {
180
- patterns.push(new RegExp(`(?:^|[;&|(!]|\\b(?:if|elif|else|then|do|while|until|exec)\\b)[^\\S\\n]*(?:\\w+=\\S*[^\\S\\n]+)*["']?((?:\\.\\.?\\/)*${escape(bin)}\\/[\\w-]+)(?![\\w./-])`, 'gm'));
180
+ // Before the command word a shell takes assignments and redirections in
181
+ // any order (`FOO=1 2>/dev/null bin x`, `>out bin x`); a redirection's
182
+ // target is a word of its own, so `> bin` writes to it and runs nothing.
183
+ const prefix = `(?:(?:\\w+=\\S*|\\d*(?:&>>?|<<<|<>|>>|<|>)&?[^\\S\\n]*[^\\s;&|<>]+)[^\\S\\n]+)*`;
184
+ patterns.push(new RegExp(`(?:^|[;&|(!]|\\b(?:if|elif|else|then|do|while|until|exec)\\b)[^\\S\\n]*${prefix}["']?((?:\\.\\.?\\/)*${escape(bin)}\\/[\\w-]+)(?![\\w./-])`, 'gm'));
181
185
  }
182
186
  return patterns;
183
187
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veda-hq/pariksha",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "description": "Repository checks: doc drift, rule enforcement, test-quality ratchets. Checks: authority-citations, boundary, codec-registry, coverage-by-type, coverage-exemptions, doc-budgets, enforcement-claims, env-gate-switches, export-deletions, fault-injection-registry, required-settings. Also markdownlint rules for Markdown that renders mangled: @veda-hq/pariksha/markdownlint.",
5
5
  "keywords": [
6
6
  "repository checks",