59 Commits

Author SHA1 Message Date
Nanda H Krishna
5ccfbcd1d2
Autocorrect style issues with brew style --fix 2021-07-08 12:36:39 +05:30
Carlo Cabrera
92d224f0fc
rubocops/lines: check allowlist for use of ENV.runtime_cpu_detection
This is implements the first audit discussed in #11608.
2021-07-01 18:38:54 +01:00
Bo Anderson
9063945b3e
Promote shell commands audit to global cop 2021-03-17 20:45:41 +00:00
Nanda H Krishna
b9cbeb3019
Merge pull request #10608 from nandahkrishna/assignment-condition-parentheses
style: use parentheses for assignment in conditions
2021-02-15 18:43:54 +05:30
nandahkrishna
8e5451df2f
style: use parentheses for assignment in conditions 2021-02-12 18:33:37 +05:30
Mike McQuaid
e8c71aeb8c
rubocops/lines: check for if ENV["CI"] usage.
Suggested in:
https://github.com/Homebrew/homebrew-core/pull/70675#issuecomment-775092539
2021-02-12 11:25:44 +00:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +00:00
Jonathan Chang
b8fb568021 rubocops/lines: use rubocop v1 API 2021-01-12 19:11:42 +11:00
Jonathan Chang
f81e89193e rubocops: update helpers for rubocop v1 API 2021-01-12 19:11:42 +11:00
souleater7
e50e3e4b22 Delete references to devel 2021-01-01 10:16:31 -08:00
Mike McQuaid
87dd13aea6
Deprecate cask requirements.
This probably has to wait until 2.7.0 now and will require a bunch of
formula changes/deprecations but we should probably start moving in this
direction given we're not installing any of these on our CI any more.
2020-12-15 14:19:45 +00:00
Rylan Polster
01cf98e526 Remove style exceptions for ProvidedByMacos and UsesFromMacos 2020-12-03 14:30:34 -05:00
Rylan Polster
629ad219aa Migrate MAKE_CHECK_ALLOWLIST 2020-11-30 18:18:50 -05:00
Mike McQuaid
0793644f62
Merge pull request #9052 from jonchang/deprecate-requirements-in-core
audit: deprecate requirements in core
2020-11-06 15:16:18 +00:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
Jonathan Chang
1b95059c2b
Restrict audit to homebrew/core
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-11-06 00:49:48 +11:00
Jonathan Chang
777dc10aa8 audit: deprecate requirements in core
This strict audit ensures that new formulae that depend on Requirements
like :x11, :java, and :osxfuse are not introduced into homebrew/core.
2020-11-06 00:20:34 +11:00
Markus Reiter
bf7fe45e89
Merge pull request #8896 from reitermarkus/sorbet-inline
Inline type annotations.
2020-10-13 10:40:53 +02:00
Rylan Polster
3b944434cf style: allow python versions with two digits 2020-10-11 09:46:14 -04:00
Rylan Polster
40e4b38d05 style: python versions must match python dependency 2020-10-10 13:59:20 -04:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Rylan Polster
38cedb9013 style: allow license exceptions to be on one line 2020-10-05 16:23:52 -04:00
Markus Reiter
52efa13222 Document rubocops/lines cops. 2020-08-26 03:13:59 +02:00
Rylan Polster
97b1b75dc5 style: forbid one line nested license expressions 2020-08-20 11:20:04 -04:00
Rylan Polster
ef447a38c6 style: convert from license array to license hash 2020-08-20 10:58:36 -04:00
Mike McQuaid
3a91c37e66
Fix RuboCop checks. 2020-08-19 17:12:32 +01:00
Markus Reiter
5d3881e1ab Don't skip RuboCop on non-existent ARGV methods. 2020-08-06 16:28:07 +02:00
Rylan Polster
55246d720e improve style in pattern matcher 2020-07-12 14:20:05 -04:00
Rylan Polster
8c0c713d6b style: don't use build.with? for dependencies 2020-07-12 12:12:36 -04:00
Rylan Polster
69e89d7a01 add TODOs for future refactoring 2020-07-10 15:08:20 -04:00
Rylan Polster
e0b5c2093a style: refactor OptionDeclarations cop 2020-07-10 11:17:37 -04: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
35a8c33690 Update shell metacharacter list 2020-06-30 10:18:49 -04: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
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
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
Issy Long
0041ea21f5
Change occurrences of "whitelist" to "allowlist" 2020-06-06 22:38:32 +01:00
Mike McQuaid
aa81982aba
brew style --fix 2020-06-02 09:49:23 +01:00
Mike McQuaid
3b9a8cb8c1
rubocops/lines: fix rule.
This stops stuff like `clang=1` from being matched incorrectly.
2020-04-14 11:59:41 +01:00
Mike McQuaid
ea77fce409
rubocops/lines: move strict cop. 2020-04-13 16:01:25 +01:00
Mike McQuaid
20998ed6e3
rubocop/lines: extract whitelist to constant. 2020-04-12 14:17:05 +01:00
Sean Molenaar
84181f2068
Audit: allow make check for nettle 2020-04-08 19:08:15 +02:00
Sam Ford
486a557cf5
rubocop/lines: add protobuf to whitelist 2020-02-16 09:34:09 -05: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
cf66c05d87 audit: avoid build-time checks in core
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-01-11 09:48:54 -08:00
Jonathan Chang
9634041f82 audit: unnecessary comments from external taps
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-01-11 09:44:20 -08:00
Jonathan Chang
7239b3099a audit: check for build.with? in core
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-01-11 09:37:10 -08:00
Jonathan Chang
779304df68 audit: add "homebrew/core" for relevant checks 2020-01-08 15:38:48 -05:00
Issy Long
1f6168fe8a
Change regexp.match?(string) to string.match?(regexp) everywhere
- Only try to call `.match?` on strings that aren't nil.
2019-10-13 23:22:51 +01:00