Markus Reiter
480e264d9a
Lint Ruby docs.
2024-05-01 11:35:21 +02:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs.
2024-05-01 11:35:20 +02:00
Justin Krehel
36cc201616
rubocops/cask/array_alphabetization: skip blank lines when sorting
2024-04-17 14:22:48 -04:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args.
2024-03-07 16:20:20 +00:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact
offenses
...
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Douglas Eichelberger
aab04229d1
Code review fixes
2024-02-11 20:27:39 -08:00
Douglas Eichelberger
c83e0170a9
Fix cask_help rbi
2024-02-11 20:27:38 -08:00
Douglas Eichelberger
b010e397d6
Add extend/node.rbi, remove unused methods
2024-02-11 20:27:38 -08:00
Douglas Eichelberger
b2dc842238
wip
2024-02-11 20:27:38 -08:00
Bevan Kay
bbebd3deec
Update shared_filelist_glob.rb
...
Co-authored-by: Kevin <apainintheneck@gmail.com>
2024-02-08 07:03:51 +00:00
Bevan Kay
60914a3f4f
rubocops/cask: fix style
2024-02-05 08:58:03 +01:00
Bevan Kay
2b60576165
rubocops/cask: add a cop for specific numbered shared file list files
2024-02-04 14:13:06 +01:00
Razvan Azamfirei
9aabe1ba91
rubocop: preserve comments when ordering uninstall methods
2024-01-28 07:08:48 -05:00
Razvan Azamfirei
db72295c20
rubocop: order uninstall methods
2024-01-28 07:08:47 -05:00
Douglas Eichelberger
8c832e0905
Remove some fixed FIXMEs
2024-01-26 12:00:13 -08:00
Issy Long
a6b8a795b4
Merge pull request #16365 from issyl0/rubocop-cask-zap-arrays-alphabetical
...
Add a new RuboCop for alphabetizing `zap trash` array elements
2024-01-24 21:34:18 +00:00
Issy Long
693a27d48b
Treat zap
and uninstall
the same
...
- Since `zap` can have more than just `trash`.
2024-01-21 19:48:30 +00:00
Issy Long
d5f9eef1b5
Empty line after guard clause, gah
2024-01-21 12:47:33 +00:00
Issy Long
458844af44
Move multi-line comments with the code they're 'attached' to
...
Co-authored-by: Bevan J. Kay <email@bevankay.me>
2024-01-21 12:42:22 +00:00
Issy Long
eec7a96fbe
Use Ruby 3.1's intersect\?
method
2024-01-20 00:38:34 +00:00
Issy Long
e9bcb64000
Double quotes not single
2024-01-20 00:35:40 +00:00
Bevan J. Kay
779f1bba7d
Move comments in tandem with the lines they belong to
2024-01-20 00:03:34 +00:00
Issy Long
dae9b0cd53
very wip and bad comment handling
2024-01-18 12:53:23 +00:00
Issy Long
338e30ff9b
There are more arrays that contain non-alphabetizeable commands
2024-01-14 20:55:51 +00:00
Issy Long
6a1cb62b42
Appease RuboCop
2024-01-14 20:55:22 +00:00
Patrick Linnane
3fdba532a2
various: fix miscellaneous typos
...
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-01-12 10:56:49 -08:00
Issy Long
9070f6d829
Check uninstall
too, avoiding arrays containing commands
2024-01-02 23:31:13 +00:00
Issy Long
fb124f92ed
Ignore non-zap trash
methods
2023-12-22 00:41:56 +00:00
Issy Long
b9f13fc35d
Better detection and replacement of non-alphabetized arrays
...
- Use `sort_by` to sort the array, rather than comparing each element
to the next.
- This doesn't error with complaints about clobbering at all when run on
`homebrew/cask`, hurray. And it also handles interpolations correctly,
rather than ignoring them.
Co-authored-by: Bevan Kay <email@bevankay.me>
2023-12-22 00:26:38 +00:00
Issy Long
f4754baa00
Ignore zap trash
stanzas with interpolation
...
- Interpolating the version into a path is a common pattern, but the interpolations
trip up the alphabetization autocorrect quite spectacularly, so let's
ignore them (for now?).
2023-12-22 00:19:03 +00:00
Mike McQuaid
a21b2dc833
rubocops/cask/on_system_conditionals: allow blocks.
...
Without this, there's an infinite loop on `brew style --fix` if you have
a `if Hardware::CPU.arm?` in a `postflight` block where it will change
back and forward between `if` and `on_os` syntax forever.
2023-12-21 10:00:46 +00:00
Issy Long
73b3ace77c
Apparently N
is alphabetically before c
; downcase the comparison
2023-12-21 01:25:18 +00:00
Rylan Polster
841a0623c6
Don't have a comment saying to remove this cop
2023-12-19 20:47:20 -05:00
Issy Long
8cf58e36e6
Add a new RuboCop for alphabetizing zap trash
array elements
...
- Part of issue 16323.
- Previously this was being done manually by Cask maintainers.
- While we're here, enforce that the `zap trash` path is not in `[]` if
it only contains a single element.
- This is buggy on actual Casks, hence the draft PR.
2023-12-19 23:42:08 +00:00
Rylan Polster
8d8cd23414
Add rubocop to enforce deprecate!
over discontinued
2023-12-17 16:49:53 -05:00
Rylan Polster
53c1e6ecdb
Add deprecate!
and disable!
to cask stanza order
2023-12-16 20:01:47 -05:00
Mike McQuaid
04866b6e39
Merge pull request #15392 from reitermarkus/remove-rubocop
...
Remove `NoDslVersion` cop.
2023-05-10 13:13:35 +01:00
Markus Reiter
46b9dba03c
Remove NoDslVersion
cop.
2023-05-10 01:02:42 +02:00
Markus Reiter
f7168bf234
Merge pull request #15336 from reitermarkus/version-head-null
...
Merge `HeadVersion` and `NullVersion` into `Version`.
2023-05-10 01:01:21 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version
to MacOSVersion
.
2023-05-09 05:08:38 +02:00
Markus Reiter
02dbeb62fc
Refactor RuboCop tests.
2023-05-09 04:28:25 +02:00
Markus Reiter
1df501b0ac
Tweak tests.
2023-05-07 10:04:28 +02:00
Markus Reiter
ce8788e5bc
Fix code style.
2023-05-07 08:34:13 +02:00
Markus Reiter
81fdb3716e
Implement StanzaOrder
cop using on_cask_stanza_block
.
2023-05-07 08:30:29 +02:00
Markus Reiter
2dea4f2370
Add on_cask_stanza_block
.
2023-05-07 08:30:08 +02:00
Issy Long
8035d46dfe
very wip but reimagined
...
- Thanks to Markus on Slack for saying "the cop should only apply to the
content of the blocks, or more specifically only to stanzas that are
direct children of cask or on_* blocks", which made me realize that
I was overcomplicating things.
2023-05-07 08:30:08 +02:00
Issy Long
a493787125
Regressed a bit, but at least it's not clobbering anymore?
2023-05-07 08:29:31 +02:00
Issy Long
704482d815
wip a test for ordering of both on_* blocks and their contents
...
- This is very broken, "detected clobbering" errors.
2023-05-07 08:29:31 +02:00
Issy Long
40bc235cb6
Simplify offending_stanzas
method - pass sorted_stanzas
in directly
...
- Otherwise we're doing the same "if inner" check twice, for no gain.
2023-05-07 08:29:30 +02:00
Issy Long
9457a23430
Extract methods for checking for on_*
blocks and their contents
...
- The same code to do the same thing was getting a bit repetitive in
`Cask/StanzaOrder`, `Cask/StanzaGrouping` and `Cask/NoOverrides`
cops.
2023-05-07 08:29:30 +02:00