329 Commits

Author SHA1 Message Date
Eric Knibbe
7698cf2098
audit: messaging improvements 2024-02-04 15:10:14 +01:00
Douglas Eichelberger
36f64d6b30 Enable Style/TopLevelMethodDefinition 2024-01-26 11:37:11 -08:00
Mike McQuaid
724e14ee25
formula_auditor: split audit_revision_and_version_scheme.
Separate this into two methods so we can have separate skips for each.
2024-01-12 14:18:00 +00:00
Douglas Eichelberger
0852e1d7b6 Refactor away String#indent 2024-01-08 13:36:45 -08:00
Michael Cho
3e428f7676
formula_auditor: split out checksum check 2023-12-20 10:22:26 -05:00
Sam Ford
ccbde5952d
FormulaAuditor: Separate stable version audit
The "stable version should not decrease" formula audit currently
prevents us from being able to create bottles when downgrading a
formula version. We previously worked around this by bumping
`version_scheme` but this wasn't an intended use case and we now
avoid using it for this purpose.

We can handle simple formula downgrades by reverting changes in a
syntax-only PR but that isn't sufficient when we need new bottles
(i.e., if additional changes have been made to the formula in the
interim time). In the latter case, the only available solution may be
to revert all changes made after the previous version using a
syntax-only PR and then create another PR to reintroduce the other
changes and create new bottles.

To avoid the aforementioned approach, this splits the stable version
audit into a separate method, so we can use `brew audit
--except=stable_version` to selectively skip it.
2023-12-15 17:27:01 -05:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Bo Anderson
688d87e839
Remove Ruby 2.6 & macOS system Ruby support code 2023-12-12 03:44:31 +00:00
Bo Anderson
af7d744af0
Fixes for Ruby 3 2023-09-29 05:25:48 +01:00
Issy Long
94d4061589
Improve PyPI package name audit wording 2023-09-06 23:16:25 +01:00
Issy Long
5d2ae98d0c
Add an audit for mismatched Python resource and PyPi package names
- Issue 14537.
- When people manually add or modify PyPI resources the `Resource#name`
  sometimes ends up out-of-sync with the PyPI package name.
2023-09-03 00:44:24 +01:00
Sam Ford
1d404e437b
dev-cmd/livecheck: avoid watchlist in test
The existing watchlist test in `dev-cmd/livecheck_spec.rb` will only
pass if the testing environment doesn't contain a livecheck watchlist
file. When a watchlist file is present, it ends up being treated as
empty (formulae and casks aren't available in tests) and produces an
`Invalid usage: No formulae or casks to check` error instead. We don't
have to worry about a watchlist file on CI but it's a potential issue
when running `brew test` locally.

This provides a bogus `HOMEBREW_LIVECHECK_WATCHLIST` value to the
`#brew` call, to ensure that any watchlist file in the testing
environment is not used for this test.

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-08-16 15:08:34 -04:00
Mike McQuaid
b3c33d34ab
Various sharding fixes
- Load paths with no API when needed (e.g. for `brew edit`)
- Use no API mode for `brew log` as it's needed there
- Define sharding format for homebrew-cask and homebrew-core inside
  `Tap` methods
- Create new formulae/casks in location defined by these `Tap` methods
- Fix a bug in Formulary that made sharded formulae lookup less
  efficient (and possibly broke it for core and some API usage)
- Fix various other hardcoded Formula/Cask directory assumptions

Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-08-04 16:43:13 +01:00
Razvan Azamfirei
33375ae938
rename class and reorganize files 2023-07-25 06:41:38 -04:00
Razvan Azamfirei
c64c834d05
bump-cask-pr: add arch-specific version support 2023-07-21 11:45:34 -04:00
Carlo Cabrera
8860d8398f
determine-test-runners: fix test 2023-05-29 23:06:09 +08:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Carlo Cabrera
f3724f00d2
determine-test-runners: fix test 2023-04-29 11:36:31 +08:00
Carlo Cabrera
ff728da97b
github_runner_matrix: remove HOMEBREW_LINUX_CLEANUP
This will allow us to remove handling of this in our workflow files in
Homebrew/core.
2023-04-27 16:45:51 +08:00
Carlo Cabrera
1a86a91c1b
determine-test-runners: fix test 2023-04-25 16:42:02 +08:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Douglas Eichelberger
b90897e280 Create git_repo attr 2023-04-15 19:35:13 -07:00
Douglas Eichelberger
1ffb77f821 cleanup 2023-04-15 19:35:13 -07:00
Douglas Eichelberger
8307255ce8 Update call sites 2023-04-15 19:35:13 -07:00
Douglas Eichelberger
429f23dcc6 Create GitRepoPath 2023-04-15 19:35:12 -07:00
Carlo Cabrera
5b8ead7bc8
Add more tests
Also, remove most integration tests, because they're slow.
2023-04-07 22:21:46 +08:00
Carlo Cabrera
87373ff12a
Move more code out of dev-cmd 2023-04-06 02:13:15 +08:00
Carlo Cabrera
5194e5c65e
Check for --eval-all before using HOMEBREW_EVAL_ALL 2023-04-05 00:03:58 +08:00
Carlo Cabrera
506f6c81a7
Support --dependents flag on macOS 2023-04-04 16:20:37 +08:00
Carlo Cabrera
c125079d0f
determine-test-runners: allow usage on macOS without --dependents 2023-04-04 13:54:35 +08:00
Carlo Cabrera
3d03d243a4
determine-test-runners: test failure modes (again) 2023-04-04 13:25:44 +08:00
Carlo Cabrera
e191dbfb9e
Improve style 2023-04-04 13:20:03 +08:00
Carlo Cabrera
7ff2382d74
determine-test-runners: fix parallel tests
Since these tests run in parallel, we want to minimise our reliance on
environment variables. Also, we need to make sure that different
examples write to different paths.
2023-04-04 12:16:54 +08:00
Carlo Cabrera
4cb50a38c7
Improve versioned macOS test 2023-04-04 02:42:14 +08:00
Carlo Cabrera
839b7d44cc
determine-test-runners: test failure modes 2023-04-04 02:30:13 +08:00
Carlo Cabrera
3d7d4c60f7
determine-test-runners_spec: hardcode fewer things 2023-04-04 02:13:35 +08:00
Carlo Cabrera
3dc66fae9f
determine-test-runners: add non-trivial tests 2023-04-04 01:46:33 +08:00
Carlo Cabrera
140e751ec6
Fix brew style 2023-04-04 01:12:05 +08:00
Carlo Cabrera
d5dc9ee5e0
determine-test-runners: test --dependents 2023-04-04 01:02:47 +08:00
Carlo Cabrera
4dc370ca24
Add some more tests 2023-04-04 00:45:54 +08:00
Carlo Cabrera
ae63b23472
determine-test-runners: add a test
I'll add more substantial tests shortly, but let's start with this one.
2023-04-03 22:42:00 +08:00
apainintheneck
2baaafba92 Cleanup irb history file in tests
This was caused by the irb spec. Note that
$HOME is set during the test setup so will
always be correct.
2023-03-09 17:07:08 -08:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
Issy Long
734a651f93
rubocop: Enable Layout/MultilineMethodCallIndentation & fix offenses
- Part of trying to reduce the number of `Excludes:` we have in our
  RuboCop configs.
- The fixes here all seemed reasonable, with some minimal tweaks for
  line length and less floatiness. Apart from `test/dev-cmd/bottle_spec.rb`
  where RuboCop wanted to do some ridiculously floaty indentation and there
  wasn't an obvious alternative place to break the lines, so I opted for
  in-line disables instead.
2023-03-03 22:18:51 +00:00
Mike McQuaid
8d02143c2b
Add generate-{cask,formula}-api commands
These replace the similar scripts in formulae.brew.sh.

Part of #14730.
2023-02-22 15:33:16 +00: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
Issy Long
f8654bd363
rubocop: In-line disables of Metrics/{Module,Block,Class}Length
- We're not going to make the really long things be any shorter any time soon.
- The instructions in issue 14685 say, pragmatically, "disable all the rubocop
  rules we're never going to realistically fix e.g. Metrics/ClassLength". But
  that felt like a slippery slope to more _really_ long modules/classes/blocks,
  and the limits are here for a reason.
2023-02-19 16:33:23 +00:00
Mike McQuaid
a743e9277f
workflows/tests: faster, more reliable tests.
- Extract update tests into separate tests.
- Make `brew tests --online` run only once in its own job. This job
  could be made non-required to fight flakiness.
- Split up the various macOS runs into several steps now that we have
  more parallel macOS workers available.
- Cleanup some flaky tests.
2023-02-17 15:26:18 +00:00
Sanjito Kurniawan
2daae5e84d
edit: add HOMEBREW_NO_INSTALL_FROM_API warning. 2023-02-14 12:04:10 +00:00