570 Commits

Author SHA1 Message Date
Sam Ford
a1993b9086
rubocops/caveats: Disallow ANSI escape codes
Formula caveats text appears on formulae.brew.sh but escape
characters, as used in ANSI escape codes, should not appear in HTML.
This commit adds a RuboCop to disallow escape characters in the
caveats text.
2023-01-16 01:30:19 -05:00
Douglas Eichelberger
8cf35cff95
Delete lines.rbi 2023-01-12 16:30:47 -08:00
Rylan Polster
d316819f0c
Add tests 2022-12-28 16:10:26 -05:00
Rylan Polster
3556e756fc
Check casks for macOS version conditionals 2022-12-28 16:10:26 -05:00
Rylan Polster
e08d4f9f31
Check for loose MacOS.version method calls 2022-12-28 16:10:26 -05:00
Rylan Polster
a504d2c1aa
Check for loose Hardware::CPU method calls 2022-12-28 16:10:26 -05:00
Mike McQuaid
e71d1e2dd4
rubocop/lines: cleanup weird interpolation. 2022-12-13 11:37:05 +00:00
Bo Anderson
917a1e7bff
rubocops/shell_commands: fix missing require 2022-12-13 11:37:05 +00:00
apainintheneck
c477b9aab3 Cleanup after adding os specific rubocop
- Change name of rubocop warning
- Disable linting on remaining offending lines
- Add todos to move lines with disabled linting
  checks to extend/os in the future
2022-11-29 23:13:50 -08:00
apainintheneck
c7d53a2d9c Add cop to police os checks
The methods `OS.linux?` and `OS.mac?` should only be used
in `extend/os` and this cop makes sure of that.
2022-11-19 22:01:13 -08:00
razamatan
e7f723e543 uses_from_macos: add mandoc to allowed list
- see https://github.com/Homebrew/homebrew-core/pull/115411
2022-11-10 21:56:23 -08:00
Bo Anderson
6ede5d2dd5
rubocops: handle empty formula body in various cops 2022-11-05 04:40:16 +00:00
Sam Ford
40199404cf
Allow livecheck method in on_system blocks
It's sometimes necessary to have a `livecheck` block in an `on_macos`
or `on_linux` block. For example, a formula may be disabled on macOS
but not on Linux. In that scenario, we only want a `livecheck` block
to apply to Linux, so livecheck will automatically skip the formula
as disabled on macOS.

While this setup works on a technical level, `brew style` will give
an `on_linux cannot include livecheck` offense. This commit addresses
the issue by adding `livecheck` to `on_system_allowed_methods` in the
`ComponentsOrder` Rubocop.

This also updates `on_system_allowed_methods` to use the order in
`FORMULA_COMPONENT_PRECEDENCE_LIST`, which may make it a bit easier
for formula maintainers to read at a glance.
2022-10-18 16:02:29 -04:00
Issy Long
b7d997e80d
sorbet: Bump some files from typed: false to typed: true
- This was done with `brew typecheck --update --suggest-typed` which
  (as of the previous commit) uses Spoom, yet another gem. I thought I'd
  see how well it works. There are no Sorbet errors after these changes!
2022-10-11 01:09:03 +01:00
Max Eisner
088dce08d6
fix: return if no install def
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2022-09-06 14:42:03 +02:00
Max Eisner
2c4ef98f0d
fix additional quotes already handled by #inspect 2022-09-06 14:42:03 +02:00
Max Eisner
ea4fb0fe09
update command comparison to *commands vararg 2022-09-06 14:42:03 +02:00
Max Eisner
3fec64f386
skip offenses for heredoc scripts and calls with custom env
needed for e.g. àwscli`, `hatch`, `pipenv`
2022-09-06 14:42:02 +02:00
Max Eisner
02c9cc0720
add check if executable and subcmd are the same before combining
e.g. ˚jrsonnet˚ needs this
2022-09-06 14:42:01 +02:00
Max Eisner
cf84800939
fix style 2022-09-06 14:42:01 +02:00
Max Eisner
5b3f5dcbf2
fix whitespace removal, fix string concatenation 2022-09-06 14:42:01 +02:00
Max Eisner
8282b15a2a
simplify and unify node handling 2022-09-06 14:42:01 +02:00
Max Eisner
e18432089b
fix typecheck 2022-09-06 14:42:00 +02:00
Max Eisner
ab6a4d757a
fix dangling enclosed comma 2022-09-06 14:42:00 +02:00
Max Eisner
a175d6b7a1
fix style 2022-09-06 14:42:00 +02:00
Max Eisner
a56feff5d0
adapt to executable and subcmd being mandatory 2022-09-06 14:42:00 +02:00
Max Eisner
60db35096f
simplify and comment dangling comma handling 2022-09-06 14:42:00 +02:00
Max Eisner
ab09d15703
remove newlines left behind after correction 2022-09-06 14:42:00 +02:00
Max Eisner
de7ef64f61
use #inspect instead of wrapping symbols 2022-09-06 14:41:59 +02:00
Max Eisner
a002463362
#delete_suffix instead of #sub 2022-09-06 14:41:59 +02:00
Max Eisner
1b15d03634
remove always-true condition 2022-09-06 14:41:59 +02:00
Max Eisner
8398dfbae0
fix condition array substraction 2022-09-06 14:41:59 +02:00
Max Eisner
06518ec613
add RuboCop to combine multiple calls 2022-09-06 14:41:59 +02:00
Max Eisner
e4b67e84dd
fix shell parameter type 2022-09-06 14:41:59 +02:00
Max Eisner
d963a1ae2f
style 2022-09-06 14:41:59 +02:00
Max Eisner
2329844f50
refactor: naming 2022-09-06 14:41:58 +02:00
Max Eisner
50ae38a372
add :arg shell_parameter 2022-09-06 14:41:58 +02:00
Max Eisner
b901e5873d
do not use parantheses if no args given to method 2022-09-06 14:41:58 +02:00
Max Eisner
0509eebda4
fix: don't write binary param if base_name == binary/base_name 2022-09-06 14:41:58 +02:00
Max Eisner
fd98c3df58
add preliminary RuboCop for generate_completions DSL 2022-09-06 14:41:57 +02:00
Rylan Polster
1c54e915b6
Update cask rubocops to use on_arch blocks and sha256 arm:, intel: 2022-08-25 00:49:28 -04:00
Rylan Polster
3f00893201
Include on_{system} blocks as stanzas in rubocop 2022-08-23 14:09:29 -04:00
Rylan Polster
af99dfba00
Refactor on_system rubocops for use in casks 2022-08-14 17:31:07 -04:00
Rylan Polster
dd2b1ce7e9
Merge pull request #13681 from Rylan12/cask-variables-rubocop
Add and adjust cask rubocops to handle variables
2022-08-11 20:05:08 -04:00
Rylan Polster
ec132ff851
Add and adjust cask rubocops to handle variables 2022-08-10 17:45:43 -04:00
Rylan Polster
39071d5816
Remove arch from cask stanza ordering temporarily 2022-08-10 15:37:28 -04:00
Mike McQuaid
6b697470fd
brew style --fix
For https://github.com/Homebrew/brew/pull/13671
2022-08-10 14:19:33 +01:00
Rylan Polster
dd72f1ac95
Add arch cask DSL 2022-08-05 17:12:55 -04:00
fn ⌃ ⌥
d5f949e60b Check dependency order in on_system methods 2022-08-03 06:33:30 -07:00
Rylan Polster
2c3926ae1e
Check nesting for blocks with one child 2022-07-24 23:37:36 +02:00