simple_english 0.12.0-aarch64-linux → 0.13.1-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b5b5ff768caae05ffb5aeb9df64b4ecb31b2cf5128366a3a2cce154f1f94fe9
4
- data.tar.gz: b298b915f34c3060dae2b6f90fa78f4a5dd1fe912b8be6d532fd3f031f894719
3
+ metadata.gz: f5b1893ae8517afaeed4fec345cbbcba5e63afc9ad9d7c2a84b45b10caa618f0
4
+ data.tar.gz: 5684145341a81cc250b5846ce6117bfd9243a33075b0d8a690557d5f8a2cc541
5
5
  SHA512:
6
- metadata.gz: 9ded9b7cd8890fff2dad83a0d0eb272e29ab99e9feb33926733f512011a5299c86a947605eabbbb28b129621f06cfcd4988d566d4a09e0c588a2a1ec078c262f
7
- data.tar.gz: 2b9acfc5fc537d7d177d14b9607a1714660f96868be5906e8d00c3b4ac2979fabc5453e2c57a8b9e0d4a9b9fde439e8860ecbab5d9cf442aecd0227885810630
6
+ metadata.gz: 461da574e50a104180429444a13c941736482ebee31878de3a7a5871c20b39b21a3f62a4c28dc879263c36facaf640b16c116362ecb930ea5913a2bc78392eeb
7
+ data.tar.gz: 4b09565c9852a9a15a1b67ae5658a9fb32d82145640deaaf9c3a63837966c3e52b1279ba2a5ab00ac9005c3f387569af797d3308ac931e74b2dad51dbf6ef6a1
data/README.md CHANGED
@@ -72,6 +72,27 @@ The full list, with a wrong and a right example for each rule [docs/RULES.md](do
72
72
 
73
73
  ## Install
74
74
 
75
+ ### Prerequisites
76
+
77
+ The gem needs Ruby 3.3 or newer. On a Mac, the system Ruby (2.6) is too
78
+ old. Install one, for example with Homebrew:
79
+
80
+ ```bash
81
+ brew install ruby
82
+ ```
83
+
84
+ Homebrew's Ruby is not on the `PATH` by default, and neither are gem
85
+ binaries. Put both in your shell profile:
86
+
87
+ ```bash
88
+ echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
89
+ echo 'export GEM_HOME="$HOME/.gem"' >> ~/.zshrc
90
+ echo 'export PATH="$GEM_HOME/bin:$PATH"' >> ~/.zshrc
91
+ ```
92
+
93
+ Then open a new terminal. A version manager such as `mise` or `rbenv`
94
+ works too.
95
+
75
96
  ### Ruby gem (macOS arm64, Linux x86-64 and arm64)
76
97
 
77
98
  ```bash
@@ -146,7 +167,7 @@ jobs:
146
167
  runs-on: ubuntu-latest
147
168
  steps:
148
169
  - uses: actions/checkout@v7
149
- - uses: TonyCTHsu/simple-english@v0.12.0
170
+ - uses: TonyCTHsu/simple-english@v0.13.1
150
171
  with:
151
172
  files: |
152
173
  docs/
@@ -158,7 +179,7 @@ To see the findings inline in the pull request, lint with
158
179
  `permissions: {security-events: write}` to the workflow:
159
180
 
160
181
  ```yaml
161
- - uses: TonyCTHsu/simple-english@v0.12.0
182
+ - uses: TonyCTHsu/simple-english@v0.13.1
162
183
  with:
163
184
  format: sarif
164
185
  - uses: github/codeql-action/upload-sarif@v3
@@ -181,7 +202,7 @@ is `se lint`.
181
202
  # .pre-commit-config.yaml
182
203
  repos:
183
204
  - repo: https://github.com/TonyCTHsu/simple-english
184
- rev: v0.12.0
205
+ rev: v0.13.1
185
206
  hooks:
186
207
  - id: se-lint
187
208
  ```
@@ -200,10 +221,27 @@ ignore:
200
221
  - vendor/**
201
222
  disabled-rules:
202
223
  - SE_NO_EMDASH
224
+ rule-ignores:
225
+ SE_MODAL_RESTRICTED:
226
+ - .agents/skills/**
203
227
  ```
204
228
 
205
229
  `ignore` globs: `**` crosses directories, `*` stays in one segment.
206
230
 
231
+ `disabled-rules` drops a rule from every file. `rule-ignores` drops
232
+ a rule only on the listed paths. The rule still fires everywhere
233
+ else. It covers prose that plays by different rules, like spec
234
+ text that quotes a standard's "SHOULD": <!-- se: ignore=SE_MODAL_RESTRICTED -->
235
+
236
+ ```yaml
237
+ rule-ignores:
238
+ SE_MODAL_RESTRICTED:
239
+ - .agents/skills/**
240
+ ```
241
+
242
+ With that config, `SE_MODAL_RESTRICTED` fires in `docs/` and the
243
+ README, and stays quiet under `.agents/skills/`.
244
+
207
245
  ### Inline suppressions
208
246
 
209
247
  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) and disabled-rules (rule IDs dropped
5
- # from every file). Loaded from the CWD.
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
- candidates.any? { |candidate| config[:ignore].any? { |pattern| matches?(pattern, candidate) } }
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
- def filter(config, findings)
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
- findings.reject { |finding| disabled.include?(finding.rule) }
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
@@ -33,8 +33,18 @@ module SimpleEnglish
33
33
  end
34
34
 
35
35
  def setup_error
36
- "lint engine not found or not executable at #{executable}. " \
37
- "Install a supported platform build of this gem."
36
+ if executable != LanguageTool::BUNDLED_EXECUTABLE
37
+ "#{LanguageTool::EXECUTABLE_ENV} points at a missing or " \
38
+ "non-executable file: #{executable}"
39
+ elsif File.directory?(File.dirname(executable))
40
+ "the lint engine is missing or not executable at " \
41
+ "#{executable}; reinstall the gem"
42
+ else
43
+ "this copy ships no lint engine: a source checkout and the " \
44
+ "plain gem both do. Install a platform build of the gem, or " \
45
+ "point #{LanguageTool::EXECUTABLE_ENV} at a languagetool-server " \
46
+ "binary."
47
+ end
38
48
  end
39
49
  end
40
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleEnglish
4
- VERSION = "0.12.0"
4
+ VERSION = "0.13.1"
5
5
  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: 35722a07e3544928d59be6d6d05ebe3c5a2c0a84bdadb7ea18051071cc58aa8f
4
+ sha256: d9f4f9ce0e05057c60683fce2562fb572e8198158ba71c9f70bfa65cd5be07ca
@@ -4,7 +4,7 @@
4
4
  "serialNumber" : "urn:uuid:c99881b6-e8ff-383d-92df-6845602c70c5",
5
5
  "version" : 1,
6
6
  "metadata" : {
7
- "timestamp" : "2026-10-19T20:22:10Z",
7
+ "timestamp" : "2026-11-08T22:23:13Z",
8
8
  "lifecycles" : [
9
9
  {
10
10
  "phase" : "build"
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.12.0
4
+ version: 0.13.1
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-10-19 00:00:00.000000000 Z
11
+ date: 2026-11-08 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.12.0/CHANGELOG.md
181
+ changelog_uri: https://github.com/TonyCTHsu/simple-english/blob/v0.13.1/CHANGELOG.md
182
182
  post_install_message:
183
183
  rdoc_options: []
184
184
  require_paths: