255 Commits

Author SHA1 Message Date
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
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
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
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
ba62b988e1
Merge pull request #7840 from Rylan12/remove-iso-8601-hyphen
Remove hyphen in ISO 8601 in rubocops/deprecate_spec.rb
2020-06-27 13:15:55 +01: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
9c44e39a39 Remove hyphen in ISO 8601 in rubocops/deprecate_spec.rb 2020-06-26 21:32:18 -04: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
Rylan Polster
9520eabc35 style: enforce ISO-8601 in deprecation date 2020-06-26 11:53:42 -04:00
Frank Lam
644ae115f5
Prepare inline patch specs 2020-06-25 22:29:34 +08: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
Issy Long
0041ea21f5
Change occurrences of "whitelist" to "allowlist" 2020-06-06 22:38:32 +01:00
Michka Popoff
c494528f15 on_os_blocks: add audit 2020-06-04 17:36:28 +02:00
Mike McQuaid
aa81982aba
brew style --fix 2020-06-02 09:49:23 +01:00
Mike McQuaid
ca47992a6c
Fix rubocop-performance brew style. 2020-05-22 08:52:26 +01:00
Mathäus Zingerle
bb9665ced8 Migrate scheme checks for cvs, bzr, hg, fossil, and svn+http to Rubocop 2020-05-20 20:52:00 -05:00
Mathäus Zingerle
82ba0475ad audit: Port version checks that do not rely on Formula state to RuboCop and add tests 2020-05-18 10:12:13 -05:00
nandahkrishna
a4f9a66406
livecheck: add component order rubocop 2020-05-15 19:00:14 +05:30
vidusheeamoli
f851688541 audit: Port audit_keg_only to rubocop and add tests
audit: add test

audit: fixed test

audit: added another test case

audit: fix test

audit: fix test

audit: fix keg only
2020-05-05 10:47:49 +05:30
Mike McQuaid
8eed72cd8b
Move file mode audit to RuboCop. 2020-04-18 15:44:24 +01:00
Mike McQuaid
ea77fce409
rubocops/lines: move strict cop. 2020-04-13 16:01:25 +01:00
Mike McQuaid
9b5a0767cb
rubocops/formula_desc: merge cops, slim whitelist. 2020-04-13 16:01:25 +01:00
Mike McQuaid
476a61f51c
rubocops/class: rename, move cops, readd strict. 2020-04-13 16:01:25 +01:00
Mike McQuaid
b75733f1bd
rubocops: downgrade strict cops (passing in core). 2020-04-12 14:17:06 +01:00
Mike McQuaid
56c02485e0
rubocops: test whitelists. 2020-04-12 14:17:05 +01:00
Issy Long
857393ccfb
Audit correct uses_from_macos usage with RuboCop
- This builds on @jonchang's work that started in #6265.
- We now use `uses_from_macos` to declare dependencies that are implicit
  on macOS because they ship with macOS, but they're needed on Linux. We
  have to be sure that the dependencies people specify as
  `uses_from_macos` are actually shipped with macOS. So, we maintain a
  safelist of those dependencies and check against it.
- Also add more legitimate `uses_from_macos` dependencies to the list.
- This is runnable with `brew audit --only-cops=FormulaAudit/UsesFromMacos`.
- It produces different number of failures on macOS vs. Linux, because
  apparently we've not synced Homebrew/linuxbrew-core upstream thoroughly
  enough yet.
- Originally this was designed as a `--strict` audit, but we flipped it
  to be a normal audit because - to quote Mike - this is "sufficiently
  robust" now.
2020-04-06 13:42:27 +01:00
Alexander Bayandin
b37c3e9cb2 rubocops/patches: suggest url with full_index=1 2020-03-15 11:24:38 +00:00
EricFromCanada
29006396dd audit: check apache.org URLs 2020-02-24 13:07:46 -05:00
Gautham Goli
acde828a45 ARGV: Replace ARGV.verbose? with Homebrew.args.verbose? 2020-02-02 14:00:04 +01:00
Mike McQuaid
6bc72cf18a
rubocop/lines: add whitelist.
Let's only allow cryto or libraries.
2020-01-29 12:17:21 +00:00
Jonathan Chang
abf2b83b35 audit: add uses_from_macos dependency ordering 2020-01-12 11:12:27 -08:00
Jonathan Chang
cf66c05d87 audit: avoid build-time checks in core
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-01-11 09:48:54 -08:00