766 Commits

Author SHA1 Message Date
Dustin Rodrigues
de8cc4106a style: don't allow PR/MR urls for patches 2020-08-01 16:20:46 -04:00
Dustin Rodrigues
af3ea7d5aa Revert "style: don't allow PR/MR urls for patches"
This reverts commit 7a2483728c18e9cfb45e4b3f079687ec5a8e1503.
2020-07-28 21:20:46 -04:00
Dustin Rodrigues
7a2483728c style: don't allow PR/MR urls for patches 2020-07-28 10:18:26 -04:00
Mike McQuaid
25db60ebbb
Unify (mostly) Homebrew code style
Make the Homebrew/cask and Homebrew/homebrew-core style more closely
match the rest of Homebrew.

To accomplish this:
- Run `brew cask style` to ensure we don't break style there when
  making changes or upgrading RuboCop in Homebrew/brew.
- Fix the HomepageMatchesUrl cop to better handle weird input.
- Remove the now unneeded `.rubocop_shared.yml`
- Fix the cask fixtures with `brew cask style --fix`.
- Share more style between Homebrew/brew, casks and formulae.
2020-07-27 12:57:40 +01:00
Dawid Dziurla
2cd72908bc
Merge pull request #7863 from iMichka/single-resource
on_os resources: allow linux-only or mac-only resources
2020-07-20 16:58:30 +02:00
Rylan Polster
70dfaf3b42 Add link to pypi downloads page to problem message 2020-07-18 14:22:05 -04:00
Rylan Polster
5f3f7d010b Require long urls for pypi and pythonhosted urls 2020-07-18 14:05:46 -04:00
Rylan Polster
936f4bbff4 refactor share path node matcher 2020-07-12 16:06:50 -04:00
Rylan Polster
d8fb850fa9 fix pkgshare missing slash issue 2020-07-12 14:20:50 -04:00
Rylan Polster
55246d720e improve style in pattern matcher 2020-07-12 14:20:05 -04:00
Rylan Polster
6119934efb style: refactor pkgshare cop 2020-07-12 12:12:36 -04:00
Rylan Polster
8c0c713d6b style: don't use build.with? for dependencies 2020-07-12 12:12:36 -04:00
Rylan Polster
074f79840c style: refactor prefix path check 2020-07-12 12:12:36 -04:00
Michka Popoff
edd1685d37 on_os resources: allow linux-only or mac-only resources
This is now allowed since #7833 has been fixed.
2020-07-10 23:16:43 +02:00
Rylan Polster
69e89d7a01 add TODOs for future refactoring 2020-07-10 15:08:20 -04:00
Rylan Polster
9e52712b08 style: don't need require "formula" 2020-07-10 11:17:37 -04:00
Rylan Polster
1a703a1234 regex_match_group: handle non UTF-8 encoded strings 2020-07-10 11:17:37 -04:00
Rylan Polster
e0b5c2093a style: refactor OptionDeclarations cop 2020-07-10 11:17:37 -04:00
Rylan Polster
1859162735 style: use pkgshare instead of share/foo 2020-07-10 11:17:37 -04:00
Rylan Polster
792533462a style: don't use prefix + directory 2020-07-10 11:17:37 -04:00
Rylan Polster
b4a9565b8b style: require java dependency for JAVA_HOME 2020-07-10 11:17:37 -04:00
Rylan Polster
9ad342eba0 style: don't concatenate in string interpolation 2020-07-10 11:17:37 -04:00
Rylan Polster
63b81d847a style: env :userpaths is deprecated 2020-07-10 11:17:37 -04:00
Rylan Polster
1e943d7b6f style: env :std deprecated in homebrew-core 2020-07-10 11:17:37 -04:00
Rylan Polster
bd8805b14f style: separate make commands 2020-07-10 11:17:37 -04:00
Michka Popoff
9c3cc31cb4 uses_from_macos: move cpio to shadowed by macos list 2020-07-08 22:59:41 +02:00
EricFromCanada
8540aaf218 audit: disallow capitalization and period in conflicts_with reason 2020-07-07 13:25:54 -04:00
Mike McQuaid
fa760a2f26
Fix brew style. 2020-07-07 13:12:37 +01:00
Mike McQuaid
720a00e68e
formula_desc: handle nil first character. 2020-07-07 12:23:29 +01:00
Michka Popoff
5b82005829 uses_from_macos: allow cpio
as it is provided by macOS
2020-07-06 23:31:39 +02:00
Mike McQuaid
6211d0da13
Merge pull request #7691 from Rylan12/popen_read-audit
style: separate shell command arguments
2020-07-06 09:15:52 +01:00
Rylan Polster
ae0d37e911 Transfer to FormulaAuditStrict 2020-07-05 13:57:49 -04:00
Rylan Polster
0786003fe9 Add tests for autocorrect 2020-07-05 12:12:36 -04:00
Rylan Polster
e252de5295 style: improve keg_only style checks 2020-07-03 14:35:32 -04:00
lionellloh
7358dd7bba style fixes 2020-06-30 23:25:51 +08:00
lionellloh
1422542a07 components_order and test 2020-06-30 23:18:04 +08:00
Rylan Polster
35a8c33690 Update shell metacharacter list 2020-06-30 10:18:49 -04:00
Michka Popoff
8d55c87adb
components order: fix audit and add test 2020-06-30 08:36:11 +01:00
Rylan Polster
d921e94a2b rubocop: separate args for shell commands
Use `system "foo", "bar"` instead of `system "foo bar"`. Also applies to
`Utils.popen_read` and `Utils.popen_write` commands. RuboCop can
automatically fix these problems.
2020-06-29 13:26:58 -04:00
Mike McQuaid
58de51f2ce
Merge pull request #7837 from FTLam11/7392-migrate-audit-rules-to-rubocop
audit: Move patch checks from brew audit to rubocop
2020-06-27 13:11:51 +01:00
Mike McQuaid
21069e3797
Merge pull request #7696 from Rylan12/audit-shell-variables
style: set shell variables in hash
2020-06-27 13:10:35 +01:00
Rylan Polster
e82084583a style: set shell variables in hash
When running Utils.popen (or similar popen command), having a line like
"SHELL=bash ..." doesn't work properly. Instead, use:
`Utils.popen({ "SHELL" => "bash" }, "...")`
2020-06-26 16:39:39 -04:00
Frank Lam
ffb1cc8e19
Find patch nodes nested inside blocks 2020-06-27 03:13:50 +08:00
Frank Lam
afb8445380
Add inline patch checks to patches cop 2020-06-27 01:10:52 +08:00
Rylan Polster
9520eabc35 style: enforce ISO-8601 in deprecation date 2020-06-26 11:53:42 -04:00
Rylan Polster
59f622d4ba
Merge pull request #7823 from Rylan12/rubocop-dstr-string-content
RuboCop string_content keep string interpolation
2020-06-25 12:19:27 -04:00
Rylan Polster
cb187f6846 RuboCop string_content keep string interpolation 2020-06-25 09:05:43 -04:00
Mike McQuaid
ac0665daff
Refer to default branch in links with HEAD
Anywhere we can use `blob/master` we can use `blob/HEAD` instead. This
will make life easier if we ever rename our default branch in future
(once/if Git and GitHub provides the necessary tooling to do so).
2020-06-25 11:38:40 +01:00
Rylan Polster
0faf17b1e6 use safe_popen_read instead of popen_read
RuboCop requires using Utils.safe_popen_read and Utils.safe_popen_write
instead of Utils.popen_read and Utils.popen_write respectively.

Using the "safe" version means that an error will be shown if the
command fails. Previously, when using `popen_read`, a failed command can
go unnoticed and have negative consequences that go undetected (as
happened for pipend in
https://github.com/Homebrew/homebrew-core/pull/55682)

RuboCop does not require Utils.safe_popen_read in a test do block
because there can be some legitimate uses for Utils.popen_read in these
cases.
2020-06-23 13:57:33 -04:00
Dario Vladovic
8a62f891e1
formula: add std_cargo_args 2020-06-22 14:39:49 +02:00