@pragmatiks/lint 0.10.0 → 0.10.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## js-v0.10.1 (2026-11-08)
4
+
5
+ ### Bug Fixes
6
+
7
+ - **rules**: flag pure-prefix results bound only to _ in pra-pure-call-result-dropped (PRA-733)
8
+
3
9
  ## js-v0.10.0 (2026-11-08)
4
10
 
5
11
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pragmatiks/lint",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Pragmatiks engineering principles eslint config and bundled semgrep rules.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,16 +1,28 @@
1
1
  rules:
2
2
  - id: pra-pure-call-result-dropped
3
- patterns:
4
- - pattern-regex: '(?m)^[ \t]*(?:await[ \t]+)?(?:(?:self|cls)\.)?(?:compute|build|derive|format|parse|extract)_\w+\((?![^\n]*\)[ \t]*[.\[])(?:[^\n]*[(),])?[ \t]*$'
5
- - pattern-not-inside: $CALL(...)
6
- - pattern-not-inside: "[...]"
7
- - pattern-not-inside: "{...}"
8
- - pattern-not-inside: "(...)"
9
- - pattern-not-inside: '"..."'
10
- - pattern-not-inside: $TARGET = $VALUE
11
- - pattern-not-inside: "$TARGET: $TYPE = $VALUE"
3
+ pattern-either:
4
+ - patterns:
5
+ - pattern-either:
6
+ - pattern: _ = $FUNCTION(...)
7
+ - pattern: _ = await $FUNCTION(...)
8
+ - pattern: _ = self.$FUNCTION(...)
9
+ - pattern: _ = await self.$FUNCTION(...)
10
+ - pattern: _ = cls.$FUNCTION(...)
11
+ - pattern: _ = await cls.$FUNCTION(...)
12
+ - metavariable-regex:
13
+ metavariable: $FUNCTION
14
+ regex: '^(compute|build|derive|format|parse|extract)_\w+$'
15
+ - patterns:
16
+ - pattern-regex: '(?m)^[ \t]*(?:await[ \t]+)?(?:(?:self|cls)\.)?(?:compute|build|derive|format|parse|extract)_\w+\((?![^\n]*\)[ \t]*[.\[])(?:[^\n]*[(),])?[ \t]*$'
17
+ - pattern-not-inside: $CALL(...)
18
+ - pattern-not-inside: "[...]"
19
+ - pattern-not-inside: "{...}"
20
+ - pattern-not-inside: "(...)"
21
+ - pattern-not-inside: '"..."'
22
+ - pattern-not-inside: $TARGET = $VALUE
23
+ - pattern-not-inside: "$TARGET: $TYPE = $VALUE"
12
24
  message: "principle #7 a compute, build, derive, format, parse or extract function is pure, so a call whose result is dropped does nothing. Use the result, or call the function that performs the side effect."
13
25
  severity: WARNING
14
26
  languages: [python]
15
27
  metadata:
16
- note: "Matches a call statement that opens its own line, so a call used as an argument, element, assignment value or chained receiver is not flagged. Principle #7 makes these prefixes pure; a result consumed only to raise on bad input belongs in a validate function that says so."
28
+ note: "Matches a call statement that opens its own line, or a call bound to _ alone, so a call used as an argument, element, assignment value or chained receiver is not flagged. Principle #7 makes these prefixes pure; a result consumed only to raise on bad input belongs in a validate function that says so."