fop-cli 5.3.2 → 5.5.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.
Files changed (3) hide show
  1. package/README.md +93 -5
  2. package/install.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@ A Rust port of the EasyList FOP tool for sorting and cleaning ad-blocking filter
12
12
  - **Git integration**: Commit changes directly to repositories (can be disabled)
13
13
  - **easylist_adservers.txt validation**: Ensures rules start with `|` or `/`
14
14
  - **:has-text() merging**: Combines rules with same base selector into single regex
15
- - **Parallel processing**: Uses all CPU cores for faster processing via Rayon
15
+ - **Parallel processing**: Processes files in parallel via Rayon, using up to 8 worker threads. Past that, extra workers cost memory without improving throughput; set `RAYON_NUM_THREADS` to override
16
16
 
17
17
  ## Extended Syntax Support
18
18
 
@@ -106,12 +106,20 @@ fop -n ~/easylist ~/easyprivacy ~/fanboy-addon
106
106
  | `--pr-show-changes` | Include rule changes (combines, merges, typos) in PR body |
107
107
  | `--fix-typos` | Fix cosmetic rule typos in all files during sort |
108
108
  | `--fix-typos-on-add` | Check cosmetic rule typos in git additions before commit |
109
+ | `--ignore-line-minimum` | Keep rules shorter than 3 characters instead of dropping them as malformed |
109
110
  | `--auto-fix` | Auto-fix typos without prompting (use with --fix-typos-on-add) |
110
111
  | `--only-sort-changed` | Only process files changed according to git |
111
112
  | `--check-banned-list=FILE` | Check for banned domains in git additions |
112
113
  | `--auto-banned-remove` | Auto-remove banned domains and commit |
113
114
  | `--ci` | CI mode - exit with error code on failures (banned domains) |
114
- | `--rebase-on-fail` | Auto rebase and retry push if it fails |
115
+ | `--rebase-on-fail` | Auto `git pull --rebase --autostash` and retry when a push fails. **On by default** |
116
+ | `--no-rebase-on-fail` | Don't auto-rebase; print the suggested `git pull --rebase` command and stop |
117
+ | `--commit-mask=N` | Mask URLs in commit messages (1=`[.]`, 2=`(.)`, 3=space, 4=preserve subdomain dot, 5=Unicode lookalike `․`) |
118
+ | `--no-commit-mask` | Disable URL masking even when `.fopconfig` sets `commit-mask` (`--commit-mask=0` cannot: 0 falls through to level 1) |
119
+ | `--commit-mask-users=u1,u2` | Restrict `--commit-mask` to these `git config user.name` values (lowercased) |
120
+ | `--commit-mask-bare` | Also mask bare hostnames without `http(s)://`. Risks false positives on filenames |
121
+ | `--commit-mask-exempt-hosts=h1,h2` | Additional apex hosts exempt from masking (e.g. self-hosted Gitea/Forgejo/GitLab) |
122
+ | `--commit-url-template=TMPL` | Override the `Commit successful:` URL template. Placeholders: `{base}`, `{sha}`. Auto-detects Bitbucket (`/commits/`); everything else defaults to `/commit/` |
115
123
  | `--ignore-config` | Ignore .fopconfig file, use only CLI args |
116
124
  | `--output` | Output changed files with --changed suffix (no overwrite) |
117
125
  | `--check-file=FILE` | Process a single file |
@@ -128,6 +136,7 @@ fop -n ~/easylist ~/easyprivacy ~/fanboy-addon
128
136
  | `--git-binary=<path>` | Path to git binary (default: git in PATH) |
129
137
  | `--benchmark` | Benchmark sorting performance (3 iterations, dry-run) |
130
138
  | `--abp-convert` | Convert ABP extended selectors to uBO format |
139
+ | `--adguard-convert` | Promote a `:has-text()` rule's separator to AdGuard's spelling (`##` → `#?#`, `#@#` → `#@?#`) |
131
140
  | `--convert-trusted` | Convert trusted scriptlets to non-trusted when value is safe |
132
141
  | `-h, --help` | Show help message |
133
142
  | `-V, --version` | Show version number |
@@ -218,8 +227,32 @@ auto-banned-remove = false
218
227
  # CI mode - exit with error code on failures
219
228
  ci = false
220
229
 
221
- # Auto rebase and retry if push fails
222
- rebase-on-fail = false
230
+ # Auto rebase and retry if push fails (default: true).
231
+ # On failure fop runs 'git pull --rebase --autostash' and pushes again, which
232
+ # reapplies your stashed changes and can leave conflicts to resolve. Set false
233
+ # to be told the command to run instead of having it run for you.
234
+ rebase-on-fail = true
235
+
236
+ # Mask URLs in commit messages: 1=[.], 2=(.), 3=space, 4=preserve subdomain dot, 5=Unicode lookalike
237
+ # github.com, gitlab.com, and codeberg.org (and subdomains) are always exempt so PR/issue links stay clickable.
238
+ commit-mask =
239
+
240
+ # If non-empty, --commit-mask only applies when git user.name matches one of these (case-insensitive).
241
+ commit-mask-users =
242
+
243
+ # Also mask bare hostnames (no http/https). Risks FP on filenames like config.toml.
244
+ commit-mask-bare = false
245
+
246
+ # Additional apex hosts (and subdomains) exempt from masking. Adds to the
247
+ # built-in github.com / gitlab.com / codeberg.org list. Use for self-hosted
248
+ # Gitea, Forgejo, or private GitLab instances.
249
+ commit-mask-exempt-hosts =
250
+
251
+ # Override the 'Commit successful:' URL template (placeholders: {base}, {sha}).
252
+ # Default is auto-detected per host: bitbucket.org gets {base}/commits/{sha},
253
+ # everything else gets {base}/commit/{sha}. Override here if your platform
254
+ # uses something different (e.g. cgit, trac, custom redirector).
255
+ commit-url-template =
223
256
 
224
257
  # Suppress most output (for CI)
225
258
  quiet = false
@@ -254,7 +287,62 @@ add-checksum = true
254
287
  add-timestamp = true
255
288
  ```
256
289
 
257
- Supported per-file options: `no-sort`, `alt-sort`, `parse-adguard`, `localhost`, `add-checksum`, `add-timestamp`, `no-ubo-convert`, `abp-convert`, `convert-trusted`, `keep-empty-lines`, `ignore-dot-domains`, `fix-typos`.
290
+ Supported per-file options: `no-sort`, `alt-sort`, `parse-adguard`, `localhost`, `add-checksum`, `add-timestamp`, `no-ubo-convert`, `abp-convert`, `adguard-convert`, `convert-trusted`, `keep-empty-lines`, `ignore-dot-domains`, `fix-typos`, `ignore-line-minimum`.
291
+
292
+ ### Commit Message URL Masking
293
+
294
+ `--commit-mask=N` defangs URLs in commit messages so they're stored in git history in a non-clickable form. Useful for filter-list maintainers who don't want third-party scrapers, search engines, or auto-linkers to follow URLs cited in commit messages. Masking happens **after** commit-message validation (so `A:`/`P:` prefixes still validate against the real URL) but **before** `git commit -m`, so the masked form is what lands in git.
295
+
296
+ #### Levels
297
+
298
+ Using `https://www.example.com/foo/bar.html` and `https://www.example.co.nz/foo` as inputs:
299
+
300
+ | Level | Style | `www.example.com/...` | `www.example.co.nz/foo` |
301
+ |---|---|---|---|
302
+ | 1 | `[.]` | `https://www[.]example[.]com/foo/bar.html` | `https://www[.]example[.]co[.]nz/foo` |
303
+ | 2 | `(.)` | `https://www(.)example(.)com/foo/bar.html` | `https://www(.)example(.)co(.)nz/foo` |
304
+ | 3 | space | `https://www example com/foo/bar.html` | `https://www example co nz/foo` |
305
+ | 4 | preserve subdomain dot | `https://www.example[.]com/foo/bar.html` | `https://www.example[.]co[.]nz/foo` |
306
+ | 5 | Unicode `․` (U+2024) | `https://www․example․com/foo/bar.html` | `https://www․example․co․nz/foo` |
307
+
308
+ Notes:
309
+ - **Path/query/fragment dots are never masked** (only host dots), so file extensions like `bar.html` and query values like `?t=1.2` stay readable.
310
+ - **Level 4** masks only the registrable domain plus eTLD ("eTLD+1"). Compound TLDs (`co.uk`, `co.nz`, `com.au`, `co.jp`, `com.ng`, `com.hk`, `co.il`, `com.vn`, etc. — ~25 country codes) are recognised so `example.co.uk` is treated as a 2-label TLD. Apex-only inputs (`example.com`, no subdomain) still defang the only dot.
311
+ - **Level 5** is the strongest defang: U+2024 is visually nearly identical to `.` but is not in IDNA UTS #46 normalization tables, so URLs containing it won't resolve in browsers, `curl`, or most parsers — even after copy/paste. Reviewers won't realise the link is dead until they try to click it.
312
+ - **Unknown levels** (0, 6, 99…) silently fall through to level 1.
313
+ - **Exempt hosts:** `github.com`, `gitlab.com`, `codeberg.org`, and any of their subdomains (`gist.github.com`, `docs.gitlab.com`, etc.) are never masked, so PR/issue links remain clickable on the hosting platform. Lookalike hosts like `notgitlab.com` or `evil.gitlab.com.attacker.com` still get masked. For self-hosted Gitea/Forgejo/GitLab, add your host with `--commit-mask-exempt-hosts=git.company.internal,...`.
314
+
315
+ #### Choosing a level
316
+
317
+ | When to use | Level |
318
+ |---|---|
319
+ | Maximum visibility ("clearly defanged") | 1, 2, or 3 |
320
+ | Want the host structure to remain readable, only break TLD | 4 |
321
+ | Want the URL to look real but stay broken (anti-scraper) | 5 |
322
+
323
+ #### Restricting masking by user
324
+
325
+ `--commit-mask-users=name1,name2,...` (or `commit-mask-users = ...` in config) gates masking on the current `git config user.name`. If the list is empty, masking applies to whoever runs fop. If the list is non-empty, only matching users (case-insensitive) get masking; everyone else commits with the original URL.
326
+
327
+ ```ini
328
+ commit-mask = 4
329
+ commit-mask-users = fanboynz, ryanbr
330
+ ```
331
+
332
+ #### Bare hostnames (`--commit-mask-bare`)
333
+
334
+ Off by default. When enabled, also matches hostnames without an `http(s)://` prefix (e.g. `forums.lanik.us` or `www.example.com.ng`). The matcher requires at least one dot and a 2+ letter final label, so version numbers like `1.2.3` are not matched. Filenames like `config.toml` **will** match — that's the documented false-positive cost of opting in. Scheme URLs still take priority where both forms appear, and the host-exempt list (`github.com`, `gitlab.com`) applies to bare matches too.
335
+
336
+ #### Display label
337
+
338
+ After a successful commit, fop prints `Commit message:` followed by what landed in git. If masking actually changed the message, the label becomes `Commit message (masked):` instead, so it's obvious the displayed text is the masked form.
339
+
340
+ ```
341
+ Commit message (masked): A: https://www.example[.]com/foo
342
+ Commit successful: https://github.com/easylist/easylist/commit/abc1234
343
+ ```
344
+
345
+ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the plain `Commit message:` label is shown.
258
346
 
259
347
  ## Platform Support
260
348
 
package/install.js CHANGED
@@ -7,7 +7,7 @@ const path = require('path');
7
7
  const { execSync } = require('child_process');
8
8
 
9
9
  // Configuration - UPDATE THESE FOR YOUR RELEASE
10
- const VERSION = '5.3.2';
10
+ const VERSION = '5.5.0';
11
11
  const GITHUB_REPO = 'ryanbr/fop-rs'; // Change to your repo
12
12
  const BINARY_NAME = 'fop';
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fop-cli",
3
- "version": "5.3.2",
3
+ "version": "5.5.0",
4
4
  "description": "Filter Orderer and Preener - A tool for sorting and cleaning ad-blocking filter lists",
5
5
  "keywords": [
6
6
  "adblock",