aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIbrahim Awwal <ibrahim@volition.co>2025-12-10 15:52:02 -0800
committerGitHub <noreply@github.com>2025-12-10 15:52:02 -0800
commitfa5cb9b1d62a63f59e48649e478284d9fd6bb339 (patch)
tree30f23aced409a8990c85dfd36d143907a19e4f00
parent35ebd1b65291483fded1cb939cccfe28c9116782 (diff)
Pass --force-exclusion to rubocop (#380)
This make rubocop obey exclusions from config files. Otherwise, even if a file is excluded from in .rubocop.yml, apheleia will still format it. See https://docs.rubocop.org/rubocop/usage/basic_usage.html#command-line-flags
-rw-r--r--CHANGELOG.md5
-rw-r--r--apheleia-formatters.el3
-rw-r--r--test/formatters/samplecode/rubocop/out.rb3
3 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 46334a7..f36d76a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,9 +7,14 @@ The format is based on [Keep a Changelog].
### Formatters
* Use clang-format for formatting Objective-C/C++ files ([#378]).
* `bibtex-reformat` for BibTeX files.
+* `rubocop` changed to use `--force-exclusion` to obey exclusions in config
+ files ([#380]).
+
### Bugs fixed
* `shfmt` did not work with `apheleia-formatters-respect-indent-level`
+[#380]: https://github.com/radian-software/apheleia/pull/380
+
## 4.4.2 (released 2025-11-21)
### Bugs fixed
* apheleia-formatters-indent did not handle yaml-ts-mode; added with
diff --git a/apheleia-formatters.el b/apheleia-formatters.el
index 0cf5a93..0cfad9f 100644
--- a/apheleia-formatters.el
+++ b/apheleia-formatters.el
@@ -181,7 +181,8 @@
. ("python3" "-m" "json.tool"
(apheleia-formatters-indent "--tab" "--indent")))
(rubocop . ("rubocop" "--stdin" filepath "-a"
- "--stderr" "--format" "quiet" "--fail-level" "fatal"))
+ "--stderr" "--format" "quiet" "--fail-level" "fatal"
+ "--force-exclusion"))
(ruby-standard . ("standardrb" "--stdin" filepath "--fix" "--stderr"
"--format" "quiet" "--fail-level" "fatal"))
(ruby-syntax-tree . ("apheleia-from-project-root"
diff --git a/test/formatters/samplecode/rubocop/out.rb b/test/formatters/samplecode/rubocop/out.rb
index a677a10..1edea74 100644
--- a/test/formatters/samplecode/rubocop/out.rb
+++ b/test/formatters/samplecode/rubocop/out.rb
@@ -1,7 +1,8 @@
d = [30_644_250_780, 9_003_106_878,
30_636_278_846, 66_641_217_692, 4_501_790_980,
67_124_603_036, 13_161_973_916, 66_606_629_920,
- 30_642_677_916, 30_643_069_058]; a = []
+ 30_642_677_916, 30_643_069_058]
+a = []
s = $*[0]
s.each_byte do |b|
a << ('%036b' % d[b