737 Commits

Author SHA1 Message Date
Mike McQuaid
7ac31f7d65
Merge pull request #14732 from dduugg/formula-cop-mixin
Refactor FormulaCop as an abstract class
2023-02-21 23:05:58 +00:00
Douglas Eichelberger
bd5a7f6a14
Update formula_cop.rb 2023-02-21 09:52:20 -08:00
Douglas Eichelberger
387d2f859f Use exclude_from_registry instead 2023-02-20 18:14:47 -08:00
Douglas Eichelberger
d9db5e8825 Refactor FormulaCop as a mixin 2023-02-20 18:14:47 -08:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Douglas Eichelberger
a57764e4d6 Disable FormulaCop 2023-02-16 15:51:20 -08:00
Douglas Eichelberger
6c93f6fe91 Enable typing in rubocops 2023-02-16 15:51:20 -08:00
Mike McQuaid
6b4363092d
Revert "Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove"
This reverts commit 932d2cf3b77c9439a57b6a43577fc8d3b6399a62, reversing
changes made to f4e60482791d2ff628efadfdbf0d14d9237d2d29.
2023-02-07 19:25:51 +01:00
Mike McQuaid
6882ac17e7
Revert "Add deprecations and disables" 2023-02-07 15:13:19 +01:00
Mike McQuaid
3c7adc91ac
Merge branch 'deprecate-ignore_missing_libraries' into deprecate-disable-remove 2023-02-03 10:49:54 +00:00
Mike McQuaid
34b1cc2218
Merge pull request #14458 from dduugg/rm-string-extension
Remove redundant String extension
2023-01-31 11:55:43 +00:00
Douglas Eichelberger
e98e668a34 remove redundant string extension 2023-01-28 08:26:11 -08:00
Douglas Eichelberger
220becda96 remove undent 🐵-patch 2023-01-27 22:55:38 -08:00
Carlo Cabrera
f576140ade
Remove Rubocop for ignore_missing_libraries
This is no longer needed.
2023-01-26 13:48:06 +08:00
Mike McQuaid
d984ce06f2
Improve Codespaces behaviour
- ensure that homebrew/core is always tapped
- make RuboCop stop complaining about permissions
2023-01-25 16:05:02 +00:00
Carlo Cabrera
86161e8c32
Fix test failures 2023-01-24 14:19:28 +08:00
Carlo Cabrera
8c5e6e10a7
rubocops/lines: update hard-coded compiler check
1. `llvm-g{cc,++}` has been gone for a long time. We don't need to check
   for this anymore.
2. Also check for calling the compiler as `cc`, `c89`, `c99`, or `c++`.
2023-01-24 14:04:51 +08:00
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