simple_english 0.12.0-aarch64-linux → 0.13.0-aarch64-linux
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.
- checksums.yaml +4 -4
- data/README.md +20 -3
- data/lib/simple_english/lint/linter.rb +3 -3
- data/lib/simple_english/setup/config.rb +30 -7
- data/lib/simple_english/version.rb +1 -1
- data/libexec/simple_english/languagetool-server +1 -1
- data/libexec/simple_english/languagetool-server.sbom.json +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87cffd4908d49ea4565d888ad1078a4286d703704b7029d29661e92fa0e3c9ac
|
|
4
|
+
data.tar.gz: c77d7eaa395383ab1e9bd15e307533c8298a4a55303f89686b7ea1007d354025
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f9f7640407142245fb175376aa80b66ab7a460b883bee56d313425fd91261e27e382cb2178f61e5c23f1861ad62e0b821aa7368d3e7fedd9c71856a55b92244
|
|
7
|
+
data.tar.gz: b772d068c8aae8f642ea4381d5f3435f3b6b342fd5a5361c32cc21e1f3afee4ec7fd61cafb163d7d681c8f9c5f97312e33dfe13c05e8e601d85a77b855ea9d9a
|
data/README.md
CHANGED
|
@@ -146,7 +146,7 @@ jobs:
|
|
|
146
146
|
runs-on: ubuntu-latest
|
|
147
147
|
steps:
|
|
148
148
|
- uses: actions/checkout@v7
|
|
149
|
-
- uses: TonyCTHsu/simple-english@v0.
|
|
149
|
+
- uses: TonyCTHsu/simple-english@v0.13.0
|
|
150
150
|
with:
|
|
151
151
|
files: |
|
|
152
152
|
docs/
|
|
@@ -158,7 +158,7 @@ To see the findings inline in the pull request, lint with
|
|
|
158
158
|
`permissions: {security-events: write}` to the workflow:
|
|
159
159
|
|
|
160
160
|
```yaml
|
|
161
|
-
- uses: TonyCTHsu/simple-english@v0.
|
|
161
|
+
- uses: TonyCTHsu/simple-english@v0.13.0
|
|
162
162
|
with:
|
|
163
163
|
format: sarif
|
|
164
164
|
- uses: github/codeql-action/upload-sarif@v3
|
|
@@ -181,7 +181,7 @@ is `se lint`.
|
|
|
181
181
|
# .pre-commit-config.yaml
|
|
182
182
|
repos:
|
|
183
183
|
- repo: https://github.com/TonyCTHsu/simple-english
|
|
184
|
-
rev: v0.
|
|
184
|
+
rev: v0.13.0
|
|
185
185
|
hooks:
|
|
186
186
|
- id: se-lint
|
|
187
187
|
```
|
|
@@ -200,10 +200,27 @@ ignore:
|
|
|
200
200
|
- vendor/**
|
|
201
201
|
disabled-rules:
|
|
202
202
|
- SE_NO_EMDASH
|
|
203
|
+
rule-ignores:
|
|
204
|
+
SE_MODAL_RESTRICTED:
|
|
205
|
+
- .agents/skills/**
|
|
203
206
|
```
|
|
204
207
|
|
|
205
208
|
`ignore` globs: `**` crosses directories, `*` stays in one segment.
|
|
206
209
|
|
|
210
|
+
`disabled-rules` drops a rule from every file. `rule-ignores` drops
|
|
211
|
+
a rule only on the listed paths. The rule still fires everywhere
|
|
212
|
+
else. It covers prose that plays by different rules, like spec
|
|
213
|
+
text that quotes a standard's "SHOULD": <!-- se: ignore=SE_MODAL_RESTRICTED -->
|
|
214
|
+
|
|
215
|
+
```yaml
|
|
216
|
+
rule-ignores:
|
|
217
|
+
SE_MODAL_RESTRICTED:
|
|
218
|
+
- .agents/skills/**
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
With that config, `SE_MODAL_RESTRICTED` fires in `docs/` and the
|
|
222
|
+
README, and stays quiet under `.agents/skills/`.
|
|
223
|
+
|
|
207
224
|
### Inline suppressions
|
|
208
225
|
|
|
209
226
|
A line containing `se: ignore` suppresses findings reported on that
|
|
@@ -6,12 +6,12 @@ module SimpleEnglish
|
|
|
6
6
|
|
|
7
7
|
def lint_file(path, config: Config.load)
|
|
8
8
|
return [] if Config.ignore?(config, path) || !Extractor.lintable?(path)
|
|
9
|
-
lint_text(File.read(path, encoding: "UTF-8"), language: Extractor.language_for(path), config: config)
|
|
9
|
+
lint_text(File.read(path, encoding: "UTF-8"), language: Extractor.language_for(path), config: config, path: path)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def lint_text(text, language: nil, config: Config.load)
|
|
12
|
+
def lint_text(text, language: nil, config: Config.load, path: nil)
|
|
13
13
|
findings = SimpleEnglish.lint(text, language: language)
|
|
14
|
-
findings && Config.filter(config, findings)
|
|
14
|
+
findings && Config.filter(config, findings, path: path)
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
end
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# .simple-english.yml: ignore (path globs, matched against the paths
|
|
4
|
-
# given on the command line)
|
|
5
|
-
# from every file)
|
|
4
|
+
# given on the command line), disabled-rules (rule IDs dropped
|
|
5
|
+
# from every file), and rule-ignores (a rule dropped only on the
|
|
6
|
+
# listed path globs, fired everywhere else). Loaded from the CWD.
|
|
6
7
|
|
|
7
8
|
module SimpleEnglish
|
|
8
9
|
module Config
|
|
9
10
|
ConfigError = Class.new(StandardError)
|
|
10
|
-
DEFAULT = {ignore: [], disabled_rules: []}.freeze
|
|
11
|
+
DEFAULT = {ignore: [], disabled_rules: [], rule_ignores: {}}.freeze
|
|
11
12
|
|
|
12
13
|
module_function
|
|
13
14
|
|
|
@@ -17,18 +18,33 @@ module SimpleEnglish
|
|
|
17
18
|
require "yaml"
|
|
18
19
|
data = YAML.safe_load_file(file) || {}
|
|
19
20
|
{ignore: Array(data["ignore"]),
|
|
20
|
-
disabled_rules: Array(data["disabled-rules"])
|
|
21
|
+
disabled_rules: Array(data["disabled-rules"]),
|
|
22
|
+
rule_ignores: load_rule_ignores(data["rule-ignores"])}
|
|
21
23
|
rescue Psych::SyntaxError => e
|
|
22
24
|
raise ConfigError, ".simple-english.yml: #{e.message}"
|
|
23
25
|
end
|
|
24
26
|
|
|
27
|
+
# Loose like the other keys: a rule ID with no entry means the
|
|
28
|
+
# rule fires everywhere, so a wrong ID surfaces its findings
|
|
29
|
+
# instead of hiding them.
|
|
30
|
+
def load_rule_ignores(data)
|
|
31
|
+
return {} unless data.is_a?(Hash)
|
|
32
|
+
data.to_h { |rule, globs| [rule, Array(globs)] }
|
|
33
|
+
end
|
|
34
|
+
|
|
25
35
|
# Hooks pass absolute paths while ignore globs are written
|
|
26
36
|
# relative to the repo root (the CWD). Match both forms.
|
|
27
37
|
# realpath because CWD may be a symlink-resolved path while the
|
|
28
38
|
# caller's string still carries the symlink (TMPDIR on macOS).
|
|
29
39
|
def ignore?(config, path)
|
|
40
|
+
path_matches?(config[:ignore], path)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def path_matches?(globs, path)
|
|
30
44
|
candidates = [path, relative_candidate(path)].compact
|
|
31
|
-
|
|
45
|
+
globs.any? do |pattern|
|
|
46
|
+
candidates.any? { |candidate| matches?(pattern, candidate) }
|
|
47
|
+
end
|
|
32
48
|
end
|
|
33
49
|
|
|
34
50
|
def relative_candidate(path)
|
|
@@ -54,9 +70,16 @@ module SimpleEnglish
|
|
|
54
70
|
end.join("/") + "\\z")
|
|
55
71
|
end
|
|
56
72
|
|
|
57
|
-
|
|
73
|
+
# rule-ignores needs the finding's file, which findings do not
|
|
74
|
+
# carry, so the caller passes path in. A nil path (stdin, MCP
|
|
75
|
+
# text) has no path to match, so every rule fires.
|
|
76
|
+
def filter(config, findings, path: nil)
|
|
58
77
|
disabled = config[:disabled_rules]
|
|
59
|
-
|
|
78
|
+
rule_ignores = config[:rule_ignores] || {}
|
|
79
|
+
findings.reject do |finding|
|
|
80
|
+
disabled.include?(finding.rule) ||
|
|
81
|
+
(path && path_matches?(rule_ignores[finding.rule] || [], path))
|
|
82
|
+
end
|
|
60
83
|
end
|
|
61
84
|
end
|
|
62
85
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/libexec/simple_english/languagetool-server
|
|
3
3
|
size: 127207544 bytes
|
|
4
|
-
sha256:
|
|
4
|
+
sha256: f7c44f5ff279749b5c220be74fb56f0d306dc167626515abe3e7acba3fd31d09
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_english
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.0
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- TonyCTHsu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: tree_sitter_language_pack
|
|
@@ -178,7 +178,7 @@ licenses:
|
|
|
178
178
|
metadata:
|
|
179
179
|
homepage_uri: https://github.com/TonyCTHsu/simple-english
|
|
180
180
|
source_code_uri: https://github.com/TonyCTHsu/simple-english
|
|
181
|
-
changelog_uri: https://github.com/TonyCTHsu/simple-english/blob/v0.
|
|
181
|
+
changelog_uri: https://github.com/TonyCTHsu/simple-english/blob/v0.13.0/CHANGELOG.md
|
|
182
182
|
post_install_message:
|
|
183
183
|
rdoc_options: []
|
|
184
184
|
require_paths:
|