fop-cli 5.5.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.
- package/README.md +38 -13
- package/install.js +1 -1
- 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
|
|
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
|
|
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,17 @@ 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`) |
|
|
109
111
|
| `--ignore-line-minimum` | Keep rules shorter than 3 characters instead of dropping them as malformed |
|
|
110
112
|
| `--auto-fix` | Auto-fix typos without prompting (use with --fix-typos-on-add) |
|
|
111
113
|
| `--only-sort-changed` | Only process files changed according to git |
|
|
112
114
|
| `--check-banned-list=FILE` | Check for banned domains in git additions |
|
|
113
115
|
| `--auto-banned-remove` | Auto-remove banned domains and commit |
|
|
114
116
|
| `--ci` | CI mode - exit with error code on failures (banned domains) |
|
|
115
|
-
| `--rebase-on-fail` | Auto `git pull --rebase --autostash` and retry when a push fails. **On by default** |
|
|
116
|
-
| `--
|
|
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) |
|
|
117
120
|
| `--commit-mask=N` | Mask URLs in commit messages (1=`[.]`, 2=`(.)`, 3=space, 4=preserve subdomain dot, 5=Unicode lookalike `․`) |
|
|
118
121
|
| `--no-commit-mask` | Disable URL masking even when `.fopconfig` sets `commit-mask` (`--commit-mask=0` cannot: 0 falls through to level 1) |
|
|
119
122
|
| `--commit-mask-users=u1,u2` | Restrict `--commit-mask` to these `git config user.name` values (lowercased) |
|
|
@@ -134,7 +137,7 @@ fop -n ~/easylist ~/easyprivacy ~/fanboy-addon
|
|
|
134
137
|
| `--config-file=` | Custom config file path |
|
|
135
138
|
| `--show-config` | Show applied configuration and exit |
|
|
136
139
|
| `--git-binary=<path>` | Path to git binary (default: git in PATH) |
|
|
137
|
-
| `--benchmark` |
|
|
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 |
|
|
138
141
|
| `--abp-convert` | Convert ABP extended selectors to uBO format |
|
|
139
142
|
| `--adguard-convert` | Promote a `:has-text()` rule's separator to AdGuard's spelling (`##` → `#?#`, `#@#` → `#@?#`) |
|
|
140
143
|
| `--convert-trusted` | Convert trusted scriptlets to non-trusted when value is safe |
|
|
@@ -176,7 +179,7 @@ backup = false
|
|
|
176
179
|
# Keep empty lines in output
|
|
177
180
|
keep-empty-lines = false
|
|
178
181
|
|
|
179
|
-
# Don't
|
|
182
|
+
# Don't mention rules whose domain has no dot
|
|
180
183
|
ignore-dot-domains = false
|
|
181
184
|
|
|
182
185
|
# Comment line prefixes
|
|
@@ -232,6 +235,7 @@ ci = false
|
|
|
232
235
|
# reapplies your stashed changes and can leave conflicts to resolve. Set false
|
|
233
236
|
# to be told the command to run instead of having it run for you.
|
|
234
237
|
rebase-on-fail = true
|
|
238
|
+
threads = 8 # Worker threads; omit to size from the core count
|
|
235
239
|
|
|
236
240
|
# Mask URLs in commit messages: 1=[.], 2=(.), 3=space, 4=preserve subdomain dot, 5=Unicode lookalike
|
|
237
241
|
# github.com, gitlab.com, and codeberg.org (and subdomains) are always exempt so PR/issue links stay clickable.
|
|
@@ -265,6 +269,8 @@ direct-push-users =
|
|
|
265
269
|
history = A: ,P: ,M: Update,M: Cleanup,M: Sort,M: Adjust
|
|
266
270
|
```
|
|
267
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
|
+
|
|
268
274
|
Command line arguments override config file settings.
|
|
269
275
|
|
|
270
276
|
### Per-File Overrides
|
|
@@ -351,8 +357,8 @@ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the pl
|
|
|
351
357
|
| Platform | Binary | Optimization | Compatible Devices |
|
|
352
358
|
|----------|--------|--------------|-------------------|
|
|
353
359
|
| **Linux** | | | |
|
|
354
|
-
| x86_64 | `linux-x86_64` | Baseline | All 64-bit Intel/AMD |
|
|
355
|
-
| 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+) |
|
|
356
362
|
| x86 | `linux-x86_32` | Baseline | 32-bit systems, older hardware |
|
|
357
363
|
| ARM64 | `linux-arm64` | Baseline | Raspberry Pi 3/4/5, Orange Pi 3/4/5, all ARM64 |
|
|
358
364
|
| ARM64 | `linux-arm64-n1` | Neoverse N1 | Pi 5, Orange Pi 5, AWS Graviton2+, Ampere Altra |
|
|
@@ -363,14 +369,32 @@ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the pl
|
|
|
363
369
|
| **Windows** | | | |
|
|
364
370
|
| x86_64 | `windows-x86_64.exe` | Baseline | All 64-bit Windows |
|
|
365
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 |
|
|
366
373
|
| x86 | `windows-x86_32.exe` | Baseline | 32-bit Windows |
|
|
367
374
|
| ARM64 | `windows-arm64-v2.exe` | Cortex-A78 | Surface Pro X, Snapdragon laptops |
|
|
368
375
|
|
|
369
376
|
### Which binary should I use?
|
|
370
377
|
|
|
371
|
-
**Linux
|
|
372
|
-
- Use
|
|
373
|
-
-
|
|
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.
|
|
374
398
|
|
|
375
399
|
**Linux ARM64 (Raspberry Pi / Orange Pi):**
|
|
376
400
|
- Use `linux-arm64` for Pi 3, Pi 4, Orange Pi 3/4, or if unsure
|
|
@@ -382,8 +406,8 @@ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the pl
|
|
|
382
406
|
|
|
383
407
|
| Binary | Target | RUSTFLAGS |
|
|
384
408
|
|--------|--------|-----------|
|
|
385
|
-
| `linux-x86_64` | Native | - |
|
|
386
|
-
| `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) |
|
|
387
411
|
| `linux-x86_32` | `i686-unknown-linux-gnu` | - |
|
|
388
412
|
| `linux-arm64` | `aarch64-unknown-linux-gnu` | - |
|
|
389
413
|
| `linux-arm64-n1` | `aarch64-unknown-linux-gnu` | `-C target-cpu=neoverse-n1` |
|
|
@@ -392,6 +416,7 @@ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the pl
|
|
|
392
416
|
| `macos-arm64` | `aarch64-apple-darwin` | `-C target-cpu=apple-m1` |
|
|
393
417
|
| `windows-x86_64.exe` | `x86_64-pc-windows-gnu` | - |
|
|
394
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) |
|
|
395
420
|
| `windows-x86_32.exe` | `i686-pc-windows-gnu` | - |
|
|
396
421
|
| `windows-arm64-v2.exe` | `aarch64-pc-windows-msvc` | `-C target-cpu=cortex-a78` |
|
|
397
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 = '
|
|
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
|
|