488 Commits

Author SHA1 Message Date
Lionell Loh Jian An
b2cccfcf68
Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-06-19 04:00:08 +08:00
Lionell Loh Jian An
a0b0c77ee8
audit license: use present instead of blank
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-06-19 03:58:34 +08:00
Lionell Loh Jian An
b08d958064
"license id" -> "license"
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-06-19 03:39:05 +08:00
Lionell Loh Jian An
7744f181b9
Update Library/Homebrew/dev-cmd/audit.rb
Formatting change

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-06-19 03:37:31 +08:00
Lionell
610dfe0fc2 audit: fixed with PR comments. Refactored get_repo_license api call and audit_license only new_formula 2020-06-18 00:44:33 +08:00
Lionell
f1cd404839 Merge branch 'master' into license 2020-06-17 22:58:12 +08:00
lionellloh
0b95f030fd audit: fix code review changes 2020-06-17 22:13:04 +08:00
lionellloh
3bfca5bcee audit: change location of spdx.json file 2020-06-17 21:45:51 +08:00
lionellloh
03fc6b2c15 audit_spec: override core-tap attribute in online test 2020-06-17 05:19:38 +08:00
Lionell
ba824d9488 audit: remove spdx-id as a attr_reader attribute 2020-06-17 04:14:57 +08:00
Lionell
ac6ea4de46 audit: check if a license field is empty 2020-06-17 03:38:06 +08:00
lionellloh
52c6e5de76 Fixed brew style offences 2020-06-16 01:00:47 +08:00
lionellloh
ff1016b729 Modify code to load spdx data once 2020-06-16 00:19:32 +08:00
lionellloh
998ab162d4 brew audit: Included json gem, does conditional check on github 2020-06-13 03:43:02 +08:00
lionellloh
803f9dd4a3 brew audit: check if license data exists 2020-06-13 02:43:02 +08:00
lionellloh
c10b6bcc3c brew audit: Checks if a formula has a spdx license 2020-06-13 02:34:34 +08:00
Issy Long
7ad7834b15
audit: Supress pre-release audits for known pre-release formulae
- This safelists one formula that has only ever shipped pre-releases,
  from before we had the GitHub pre-release audit. So it won't fail CI
  and cause maintainers more work to determine if it's always been that
  way, or if it's new. Then, we don't have to keep comments at the top
  of files to say so for the next contributors.
- We should check this list from time to time to make sure that the
  formulae here have graduated to actual releases and we can remove
  them.
2020-06-12 15:59:30 +01:00
Mike McQuaid
0dd004f53d
dev-cmd/audit: handle nil newest_committed_revision.
Fixes #7712.
2020-06-10 08:39:41 +01:00
Mike McQuaid
2a94d382ac
audit: make audit_revision_and_version_scheme faster.
This is really, really slow at the moment for a few reasons:
- it goes through the list of revisions twice
- it checks many more revisions than it needs to

Even after these improvements it's still by far the slowest audit so
am also making it a `--git` only audit.

Additionally, to further improve default `brew audit` performance do not
run `brew style` checks when doing `brew audit` with no arguments.

`brew style` can be run quickly and efficiently on all of a tap (and is
cached) so no need to duplicate it here.
2020-06-08 15:00:09 +01:00
Issy Long
8eba9b86ab
Change occurrences of "blacklist" to "denylist" or "disallow"
- Depending on context, I've gone for either "denylist" or "disallow"
  here. "Disallow" for things in sentences, or actions, and "denylist"
  for list of things.
2020-06-06 22:38:33 +01:00
Issy Long
0041ea21f5
Change occurrences of "whitelist" to "allowlist" 2020-06-06 22:38:32 +01:00
Thierry Moisan
7a285cf476
Fix audit online release variable 2020-06-04 09:09:12 -04:00
Mike McQuaid
8b24d8c5e9
dev-cmd/audit: don't check GitHub releases without --online.
This both is more accurate and making `brew audit` without `--online` a
bit faster.
2020-06-03 17:50:57 +01:00
Mike McQuaid
aa81982aba
brew style --fix 2020-06-02 09:49:23 +01:00
Bo Anderson
f6de06d244 dev-cmd/audit: whitelist python@3.8 to be non-keg-only 2020-05-31 22:39:29 +01:00
Sean Molenaar
3567892802
Add notibility checks for casks 2020-05-26 14:21:25 +02:00
Issy Long
d14eed6cec
audit: Remove call to deprecated created_pr_comment method
```
➜ brew audit --online --new-formula --verbose turbogit
turbogit:
  * GitHub repository not notable enough (<30 forks, <30 watchers and <75 stars)
  * GitHub repository too new (<30 days old)
Error: undefined local variable or method `created_pr_comment' for Homebrew:Module
/usr/local/Homebrew/Library/Homebrew/dev-cmd/audit.rb:148:in `audit'
/usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `<main>'
```

- This was removed in 4f75a77b089e65ff9e03c65d192808aa4ea6842f. We can't
  post PR comments from GitHub Actions CI from forks.
2020-05-25 13:00:38 +01:00
Issy Long
0cced8e7bd
audit: Fix Regexp for stripping .git from repo URLs
- [For a formula named
  turbogit](https://github.com/Homebrew/homebrew-core/pull/55208), we
  didn't see any of the notability checks fail CI.
- The repo name was getting truncated to `turb`, which didn't exist, so
  the audit didn't return anything for this check.
- The Regexp to strip `.git` from the end of was not escaping the `.`,
  so it would match anything ending in `git`, not a literal `.git`.
2020-05-25 12:48:16 +01:00
Mike McQuaid
e1f3c8d2b3
Merge pull request #7579 from MikeMcQuaid/deprecations
Update deprecations
2020-05-23 14:38:10 +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
Mike McQuaid
633501ab08
audit: remove incorrect TODO.
This check can't really be in RuboCop (as it relies on the URL strategy
logic).
2020-05-20 08:17:14 +01: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
Mike McQuaid
4f75a77b08
Update deprecations
Add more deprecations, disable deprecations and remove disabled code.
2020-05-18 13:50:46 +01:00
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
Bo Anderson
b619e31457 dev-cmd/audit: fix false openssl@1.1 versioned formula audit 2020-04-22 01:00:35 +01:00
Mike McQuaid
8eed72cd8b
Move file mode audit to RuboCop. 2020-04-18 15:44:24 +01:00
Mike McQuaid
8cb90595b3
dev-cmd/audit: add TODOs for RuboCop migrations. 2020-04-18 15:30:53 +01:00
Mike McQuaid
3546c39581
audit: remove trailing newline check.
This is already done by the default RuboCop configuration.
2020-04-18 15:30:53 +01:00
Mike McQuaid
5e2351cde6
dev-cmd/audit: add --skip-style option.
This will allow `brew style` and `brew audit` to be run separately
without providing duplicates.

Additionally, run RuboCop style rules when `--strict` isn't provided and
remove a confusing reference to `style`.
2020-04-16 08:24:38 +01:00
Alexander Bayandin
5088eff96b audit: add draft release detection 2020-04-15 15:04:10 +01:00
Mike McQuaid
4fb649cad1
cmd, dev-cmd: use args.formulae_paths.
This makes these commands robust to invalid syntax.
2020-04-14 14:21:38 +01:00
Mike McQuaid
d52e870b07
rubocop: remove NewFormulaAudit.
This is no longer used anywhere.
2020-04-13 16:01:26 +01:00
Mike McQuaid
2200b1ed40
Merge pull request #7231 from hyuraku/audit_github-prerelease_or_not
audit whether GitHub prerelease or not
2020-04-13 09:09:20 +01:00
Jonathan Chang
e6e5571a07 audit: fix keg_only check 2020-04-13 14:19:58 +10:00
Mike McQuaid
afa5713e63
audit: cleanup prerelease detection. 2020-04-12 14:51:49 +01:00
Mike McQuaid
6ea6db9026
dev-cmd/audit: test presence of formulae in lists. 2020-04-12 14:17:06 +01:00
Mike McQuaid
373650d00d
KegOnlyReason: add reason helpers, rename valid. 2020-04-12 13:12:02 +01:00
hyuraku
5578845e3f repair regex condition 2020-04-12 20:23:43 +09:00
hyuraku
399caa007c chnage how to extract owner and tag 2020-04-02 23:44:55 +09:00