fop-cli 5.4.0 → 6.0.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 +42 -14
  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**: 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
15
+ - **Parallel processing**: Processes files in parallel via Rayon, using up to 8 worker threads. Past that, extra workers mostly buy memory rather than speed; set `--threads=N` (or `RAYON_NUM_THREADS`) to override
16
16
 
17
17
  ## Extended Syntax Support
18
18
 
@@ -92,7 +92,7 @@ fop -n ~/easylist ~/easyprivacy ~/fanboy-addon
92
92
  | `--no-large-warning` | Disable large change warning prompt |
93
93
  | `--backup` | Create .backup files before modifying |
94
94
  | `--keep-empty-lines` | Keep empty lines in output |
95
- | `--ignore-dot-domains` | Don't skip rules without dot in domain |
95
+ | `--ignore-dot-domains` | Don't mention rules whose domain has no dot (`\|\|cfd^`, `\|\|countly-`). Such rules are kept either way |
96
96
  | `--ignorefiles=` | Additional files to ignore (comma-separated, partial names) |
97
97
  | `--ignoredirs=` | Additional directories to ignore (comma-separated, partial names) |
98
98
  | `--ignore-all-but=` | Only process these files, ignore all others (comma-separated) |
@@ -106,14 +106,19 @@ 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
+ | `--check-rules-on-add` | Check git additions for rules that cannot work (empty selector, unbalanced brackets, malformed domain list, unknown or empty option, bare hostname, missing `||` anchor), and prompt before committing; with `--ci` it audits the committed diff and exits 1 on a defect |
110
+ | `--remove-bad-rules` | Delete defective lines instead of prompting, then commit what is left. Advice (a bare hostname, an unanchored host) is reported but kept, since it is legal syntax (implies `--check-rules-on-add`) |
111
+ | `--ignore-line-minimum` | Keep rules shorter than 3 characters instead of dropping them as malformed |
109
112
  | `--auto-fix` | Auto-fix typos without prompting (use with --fix-typos-on-add) |
110
113
  | `--only-sort-changed` | Only process files changed according to git |
111
114
  | `--check-banned-list=FILE` | Check for banned domains in git additions |
112
115
  | `--auto-banned-remove` | Auto-remove banned domains and commit |
113
116
  | `--ci` | CI mode - exit with error code on failures (banned domains) |
114
- | `--rebase-on-fail` | Auto `git pull --rebase --autostash` and retry when a push fails. **On by default** |
115
- | `--no-rebase-on-fail` | Don't auto-rebase; print the suggested `git pull --rebase` command and stop |
117
+ | `--rebase-on-fail` | Auto `git pull --rebase --autostash` and retry when a push fails, up to 5 times when another push keeps landing first. Stops at a merge conflict with instructions to finish it. A commit that could not be published makes FOP exit 1. **On by default** |
118
+ | `--threads=N` | Worker threads for the parallel pool. Defaults to the core count capped at 8; overrides `RAYON_NUM_THREADS`. |
119
+ | `--no-rebase-on-fail` | Don't auto-rebase; print the suggested `git pull --rebase` command and stop (exit 1) |
116
120
  | `--commit-mask=N` | Mask URLs in commit messages (1=`[.]`, 2=`(.)`, 3=space, 4=preserve subdomain dot, 5=Unicode lookalike `․`) |
121
+ | `--no-commit-mask` | Disable URL masking even when `.fopconfig` sets `commit-mask` (`--commit-mask=0` cannot: 0 falls through to level 1) |
117
122
  | `--commit-mask-users=u1,u2` | Restrict `--commit-mask` to these `git config user.name` values (lowercased) |
118
123
  | `--commit-mask-bare` | Also mask bare hostnames without `http(s)://`. Risks false positives on filenames |
119
124
  | `--commit-mask-exempt-hosts=h1,h2` | Additional apex hosts exempt from masking (e.g. self-hosted Gitea/Forgejo/GitLab) |
@@ -132,8 +137,9 @@ fop -n ~/easylist ~/easyprivacy ~/fanboy-addon
132
137
  | `--config-file=` | Custom config file path |
133
138
  | `--show-config` | Show applied configuration and exit |
134
139
  | `--git-binary=<path>` | Path to git binary (default: git in PATH) |
135
- | `--benchmark` | Benchmark sorting performance (3 iterations, dry-run) |
140
+ | `--benchmark[=N]` | Time the sort: one untimed warm-up, then N runs (default 5), reporting the median, min and max. Files are left untouched: no diff is built, and timestamps and checksums are not written |
136
141
  | `--abp-convert` | Convert ABP extended selectors to uBO format |
142
+ | `--adguard-convert` | Promote a `:has-text()` rule's separator to AdGuard's spelling (`##` → `#?#`, `#@#` → `#@?#`) |
137
143
  | `--convert-trusted` | Convert trusted scriptlets to non-trusted when value is safe |
138
144
  | `-h, --help` | Show help message |
139
145
  | `-V, --version` | Show version number |
@@ -173,7 +179,7 @@ backup = false
173
179
  # Keep empty lines in output
174
180
  keep-empty-lines = false
175
181
 
176
- # Don't skip rules without dot in domain
182
+ # Don't mention rules whose domain has no dot
177
183
  ignore-dot-domains = false
178
184
 
179
185
  # Comment line prefixes
@@ -229,6 +235,7 @@ ci = false
229
235
  # reapplies your stashed changes and can leave conflicts to resolve. Set false
230
236
  # to be told the command to run instead of having it run for you.
231
237
  rebase-on-fail = true
238
+ threads = 8 # Worker threads; omit to size from the core count
232
239
 
233
240
  # Mask URLs in commit messages: 1=[.], 2=(.), 3=space, 4=preserve subdomain dot, 5=Unicode lookalike
234
241
  # github.com, gitlab.com, and codeberg.org (and subdomains) are always exempt so PR/issue links stay clickable.
@@ -262,6 +269,8 @@ direct-push-users =
262
269
  history = A: ,P: ,M: Update,M: Cleanup,M: Sort,M: Adjust
263
270
  ```
264
271
 
272
+ A `.fopconfig` in the working directory travels with the repository, so it may not be yours: a pull request can add one. From there FOP ignores `git-binary`, ignores a `warning-output` outside the directory, and refuses an `output-diff` outside it. Set those on the command line, in `~/.fopconfig`, or with `--config-file`. Every other option applies as normal.
273
+
265
274
  Command line arguments override config file settings.
266
275
 
267
276
  ### Per-File Overrides
@@ -284,7 +293,7 @@ add-checksum = true
284
293
  add-timestamp = true
285
294
  ```
286
295
 
287
- 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`.
296
+ 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`.
288
297
 
289
298
  ### Commit Message URL Masking
290
299
 
@@ -348,8 +357,8 @@ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the pl
348
357
  | Platform | Binary | Optimization | Compatible Devices |
349
358
  |----------|--------|--------------|-------------------|
350
359
  | **Linux** | | | |
351
- | x86_64 | `linux-x86_64` | Baseline | All 64-bit Intel/AMD |
352
- | x86_64 | `linux-x86_64-v3` | AVX2 | Intel Haswell+ / AMD Excavator+ (~2015+) |
360
+ | x86_64 | `linux-x86_64` | Baseline + PGO | All 64-bit Intel/AMD |
361
+ | x86_64 | `linux-x86_64-v3` | AVX2 + PGO | Intel Haswell+ / AMD Excavator+ (~2015+) |
353
362
  | x86 | `linux-x86_32` | Baseline | 32-bit systems, older hardware |
354
363
  | ARM64 | `linux-arm64` | Baseline | Raspberry Pi 3/4/5, Orange Pi 3/4/5, all ARM64 |
355
364
  | ARM64 | `linux-arm64-n1` | Neoverse N1 | Pi 5, Orange Pi 5, AWS Graviton2+, Ampere Altra |
@@ -360,14 +369,32 @@ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the pl
360
369
  | **Windows** | | | |
361
370
  | x86_64 | `windows-x86_64.exe` | Baseline | All 64-bit Windows |
362
371
  | x86_64 | `windows-x86_64-v3.exe` | AVX2 | Intel Haswell+ / AMD Excavator+ (~2015+) |
372
+ | x86_64 | `windows-x86_64-msvc.exe` | MSVC + PGO | All 64-bit Windows. A trial build, see below |
363
373
  | x86 | `windows-x86_32.exe` | Baseline | 32-bit Windows |
364
374
  | ARM64 | `windows-arm64-v2.exe` | Cortex-A78 | Surface Pro X, Snapdragon laptops |
365
375
 
366
376
  ### Which binary should I use?
367
377
 
368
- **Linux/Windows x86_64:**
369
- - Use `-v3` for CPUs from ~2015+ (Haswell, Ryzen) - ~10-20% faster due to AVX2
370
- - Use baseline if unsure or on older CPUs
378
+ **Linux x86_64:**
379
+ - Use the baseline. It is built with profile-guided optimisation, trained by
380
+ sorting `test-lists/` so the profile reflects real filter lists, and it runs
381
+ on every x86_64 CPU: PGO reorders and inlines, it adds no instructions.
382
+ - `-v3` adds AVX2 targeting on top of the same PGO, worth under 1% here and
383
+ within measurement noise. The hot path is byte scanning, which `memchr`
384
+ already dispatches to AVX2 at runtime whatever the build targets, so the
385
+ flag only vectorises colder code. Take it if you want to measure it on your
386
+ own lists.
387
+
388
+ **Windows x86_64:**
389
+ - Use the baseline. `-v3` adds AVX2 targeting, for the same negligible gain
390
+ as on Linux.
391
+ - Neither carries PGO, and not for want of trying: rustup ships no profiler
392
+ runtime for `x86_64-pc-windows-gnu`, the mingw target these are built with,
393
+ so it cannot be instrumented at all. Only `x86_64-pc-windows-msvc` can.
394
+ - `-msvc` is that build: MSVC rather than mingw, with PGO, and a static CRT so
395
+ it still needs no `VCRUNTIME140.dll`. It is published for comparison while
396
+ the two are measured against each other; `npm install` continues to fetch
397
+ the mingw build. Try it if you want the speedup on Windows today.
371
398
 
372
399
  **Linux ARM64 (Raspberry Pi / Orange Pi):**
373
400
  - Use `linux-arm64` for Pi 3, Pi 4, Orange Pi 3/4, or if unsure
@@ -379,8 +406,8 @@ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the pl
379
406
 
380
407
  | Binary | Target | RUSTFLAGS |
381
408
  |--------|--------|-----------|
382
- | `linux-x86_64` | Native | - |
383
- | `linux-x86_64-v3` | Native | `-C target-cpu=x86-64-v3` |
409
+ | `linux-x86_64` | Native | `-Cprofile-use` (PGO) |
410
+ | `linux-x86_64-v3` | Native | `-C target-cpu=x86-64-v3 -Cprofile-use` (PGO) |
384
411
  | `linux-x86_32` | `i686-unknown-linux-gnu` | - |
385
412
  | `linux-arm64` | `aarch64-unknown-linux-gnu` | - |
386
413
  | `linux-arm64-n1` | `aarch64-unknown-linux-gnu` | `-C target-cpu=neoverse-n1` |
@@ -389,6 +416,7 @@ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the pl
389
416
  | `macos-arm64` | `aarch64-apple-darwin` | `-C target-cpu=apple-m1` |
390
417
  | `windows-x86_64.exe` | `x86_64-pc-windows-gnu` | - |
391
418
  | `windows-x86_64-v3.exe` | `x86_64-pc-windows-gnu` | `-C target-cpu=x86-64-v3` |
419
+ | `windows-x86_64-msvc.exe` | `x86_64-pc-windows-msvc` | `-C target-feature=+crt-static -Cprofile-use` (PGO) |
392
420
  | `windows-x86_32.exe` | `i686-pc-windows-gnu` | - |
393
421
  | `windows-arm64-v2.exe` | `aarch64-pc-windows-msvc` | `-C target-cpu=cortex-a78` |
394
422
 
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.4.0';
10
+ const VERSION = '6.0.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.4.0",
3
+ "version": "6.0.0",
4
4
  "description": "Filter Orderer and Preener - A tool for sorting and cleaning ad-blocking filter lists",
5
5
  "keywords": [
6
6
  "adblock",