851 Commits

Author SHA1 Message Date
Roland Crosby
d8df9c2ee9 Allow cargo build --lib
When building Rust packages that provide libraries but no executable
binaries, `cargo install` doesn't do anything; you need to use `cargo
build` and install any libraries manually. See e.g.
rust-lang/cargo#8294.

Unfortunately, Homebrew's Rubocop "use cargo install *std_cargo_args"
rule, as currently written, blocks all invocations of `cargo build`.
This commit changes that rule to exclude invocations of `cargo build`
that use the `--lib` argument (`--lib` specifies to Cargo that a
package's library targets should be built). This will enable library
packages to be built while retaining the "use cargo install
*std_cargo_args" message for the more common case when a Rust package
provides executable binaries.
2022-01-31 21:11:22 -05:00
Bevan Kay
8c82ec964f
Update Library/Homebrew/rubocops/cask/url_legacy_comma_separators.rb
Co-authored-by: Issy Long <issyl0@github.com>
2022-01-12 10:40:22 +11:00
Bevan Kay
d371547d5a
fix tests 2022-01-12 10:39:38 +11:00
Bevan Kay
7e24930e4e
Update Library/Homebrew/rubocops/cask/url_legacy_comma_separators.rb
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2022-01-11 01:22:22 +11:00
Bevan Kay
22d68fb99b
fix style offences 2022-01-10 21:34:51 +11:00
Bevan Kay
cc2b99c8cf
Add check for url :block 2022-01-10 21:27:20 +11:00
Bevan Kay
d5448ff54a
rubocops (cask/url): add rubocop to use csv instead of before_comma and after_comma in cask 2021-12-31 11:08:47 +11:00
Bo Anderson
9b100cf1cc
rubocops/uses_from_macos: remove gcore
gcore has been removed from homebrew-core.
2021-12-13 22:27:06 +00:00
Carlo Cabrera
0f26522fad
rubocops/lines: disallow pyoxidizer as a build/runtime dependency
PyOxidizer downloads pre-built versions of Rust and Python, and embeds
this Python into the binaries it produces.

This goes against a number of our packaging policies, so let's make sure
formulae in Homebrew/core don't do this.

See Homebrew/homebrew-core#90025.
2021-11-30 17:36:26 +08:00
Carlo Cabrera
1ffbcc04d4
rubocops/lines: allow OS.foo? in service blocks
These seem more natural, and I don't think we need to be able to mock
service blocks on other OSs.

See Homebrew/homebrew-core#90091.
2021-11-28 21:47:21 +08:00
Dawid Dziurla
55244c845b
rubocops/text: forbid "go get" only in install method 2021-11-14 14:04:14 +01:00
Bo Anderson
4836ea0ba2
Remove XQuartz handling 2021-11-05 12:40:22 +00:00
Michka Popoff
1cc7ca33c0
update: migrate everyone from linuxbrew-core to homebrew-core
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-20 11:01:38 +01:00
Bo Anderson
629dbb7c59
rubocops/urls: allow plain HTTP mirrors 2021-10-01 13:42:05 +01:00
Mike McQuaid
41e94afda5
Fix brew style
Fixes for https://github.com/Homebrew/brew/pull/12152.

Extracted into a separate PR so this can be merged immediately.
2021-09-30 10:13:53 +01:00
Bo Anderson
3e4cb206bb
rubocops: silence parser warning 2021-09-23 03:45:15 +01:00
Mike McQuaid
56753c9d08
rubocops/lines: be less strict about OS.{mac,linux}? in taps.
Fixes #12040.
2021-09-15 12:23:07 +01:00
Mike McQuaid
6992ad0caa
rubocops/uses_from_macos: remove versioned aliases.
It makes more sense to use the unversioned formulae with `uses_from_macos`
because macOS isn't shipping multiple versions of this.

If you wish to e.g. pin to a specific version you can do that by specifying the
dependency directly in an `os_linux` block.
2021-09-14 11:01:42 +01:00
Bo Anderson
861dea9ada
Bump various type strictnesses 2021-09-11 01:00:23 +01:00
Mike McQuaid
365e554f67
Revert "rubocops: allow uses_from_macos openssl@3" 2021-09-09 09:16:59 +01:00
Mike McQuaid
ebc4cce456
rubocops/lines: add some OS cop comments/exceptions.
Exclude and comment the cases the autocorrect currently doesn't work.

Follow-up from #11955.
2021-09-08 13:46:01 +01:00
Mike McQuaid
a6e4e195c1
rubocops/lines: recommend on_os/OS.os? based on context.
Recommend the use of `on_macos` and `on_linux` unless we're in
`def install`, `def post_install` or `test do` in which case recommend
`OS.mac?` and `OS.linux?` instead.
2021-09-08 13:18:07 +01:00
Jonathan Chang
b463ad0124
rubocops: allow uses_from_macos openssl@3 2021-09-07 11:20:55 -07:00
Mike McQuaid
227a96fd7f
rubocops/lines: remove OS.mac?/OS.linux? check.
This will be reimplemented in https://github.com/Homebrew/brew/pull/11955
but this allows us to merge the homebrew-core changes before that PR is
merged.

Closes https://github.com/Homebrew/brew/pull/11946
2021-09-02 13:50:23 +01:00
Sam Ford
ddde0f7589
livecheck: allow inheriting from a formula/cask 2021-08-02 09:12:22 -04:00
Nanda H Krishna
5ccfbcd1d2
Autocorrect style issues with brew style --fix 2021-07-08 12:36:39 +05:30
Dawid Dziurla
d50bd605b8
components_order: allow ignore_missing_libraries in on_os 2021-07-04 18:34:03 +02:00
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
Michael Cho
b44ecaceb7
docs: fix cask doc urls to use docs.brew.sh 2021-06-25 13:20:40 -07:00
Bo Anderson
a06d136d2c
Move Sorbet gems into an optional group 2021-06-11 08:10:30 +01:00
Alexander Bayandin
909a7aea9e
rubocops: allow uses_from_macos "git" 2021-06-08 13:03:25 +01:00
danielnachun
5af7521ab8
components_order: allow keg_only in on_macos/on_linux blocks 2021-05-30 19:03:04 -07:00
Mike McQuaid
321c165bd3
Merge pull request #11350 from Gcenx/audit-fix-xcode-build-check
audit: Remove SYMROOT
2021-05-13 13:50:40 +01:00
Dean M Greer
ceeb5ea9ec audit: Remove SYMROOT
SYMROOT is only a valid argument when -project is used.

xcodebuild has other uses than building Xcode projects.
2021-05-13 08:07:06 -04:00
Bo Anderson
e5285b5ed8
Add cop for IO.read usage 2021-05-12 13:07:24 +01:00
Bo Anderson
6e2f194e09
rubocops/shell_commands: add cop for shell metacharacters in exec 2021-05-10 16:30:00 +01:00
Carlo Cabrera
0214196b4f
rubocops/uses_from_macos: remove openlibm
This is not provided by macOS. See

    https://github.com/Homebrew/homebrew-core/pull/76528
2021-05-03 20:40:39 +01:00
Rylan Polster
ae89577b26
style: re-enable GitLab patch URL check 2021-04-19 11:19:35 -04:00
Rylan Polster
b5dec5fdbd
style: temporarily disable GitLab patch URL check 2021-04-19 09:13:06 -04:00
Jonathan Chang
ef1e07b88b
rubocops/patches: GitLab patches should use .diff
Only `.diff` URLs return output comparable to the diffs from
`git diff --full-index`. While the extra metadata from `.patch` is
nice, the instability of the patch contents is undesirable.

Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2021-04-19 09:08:14 -04:00
Nanda H Krishna
1c2d76c4e4
rubocops/patches: remove autocorrection of some URLs 2021-04-17 01:44:28 +05:30
Issy Long
a328acc9a1
rubocops/patches: Fix quoting of the patch url when autocorrecting
- The autocorrections here before were leading to changes like:

```
➜ brew style --fix brewsci/science/beetl
Formula/beetl.rb:15:11: C: [Corrected] GitHub patches should use the full_index parameter: https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1
      url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

➜ git diff
diff --git a/Formula/beetl.rb b/Formula/beetl.rb
index bbd049aa..7ec6d7bc 100644
--- a/Formula/beetl.rb
+++ b/Formula/beetl.rb
@@ -12,7 +12,7 @@ class Beetl < Formula
     # Fixes "error: 'accumulate' is not a member of 'std'"
     # Upstream commit "Little fix for compilation on mac"
     patch do
-      url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
+      url https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1
       sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d"
     end
   end

```

- This fixes the URLs generated to have quotes:

```
➜ git diff
diff --git a/Formula/beetl.rb b/Formula/beetl.rb
index bbd049aa..7ec6d7bc 100644
--- a/Formula/beetl.rb
+++ b/Formula/beetl.rb
@@ -12,7 +12,7 @@ class Beetl < Formula
     # Fixes "error: 'accumulate' is not a member of 'std'"
     # Upstream commit "Little fix for compilation on mac"
     patch do
-      url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
+      url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1"
       sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d"
     end
   end
```
2021-04-16 19:41:02 +01:00
Bo Anderson
450bc4ab33
Fix brew style 2021-03-26 14:11:03 +00:00
Bo Anderson
9063945b3e
Promote shell commands audit to global cop 2021-03-17 20:45:41 +00:00
Shaun Jackman
0bba3bc6f6 rubocops: Permit uses_from_macos "cyrus-sasl"
macOS provides /usr/lib/libsasl2.dylib
2021-03-10 08:16:24 -08:00
danielnachun
24af65302d add pcsc-lite to uses_from_macos 2021-03-08 23:40:29 -08:00
Mike McQuaid
61427d6682
Merge pull request #10770 from SeekingMeaning/unless_logical_operators
rubocops: use `Style/UnlessLogicalOperators`
2021-03-05 11:45:42 +00:00
nandahkrishna
d68452f232
rubocops/patches: autocorrect some offenses 2021-03-04 12:36:18 +05:30
Seeker
7e7274aaeb rubocops: use Style/UnlessLogicalOperators
Replaces `Style/UnlessMultipleConditions`
2021-03-03 01:39:11 -08: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