506 Commits

Author SHA1 Message Date
Rui Chen
8ff1ca644d disable license check for new formulae
return when license is blank

Co-authored-by: Bo Anderson <mail@boanderson.me>
2020-07-01 17:22:07 -04:00
Lionell
fb4db63e3b Merge branch 'master' into license 2020-06-30 22:25:17 +08:00
Pranas Ziaukas
455633f7d2 Throttle balena-cli version bumps
Discussion in Homebrew/homebrew-core#57082
2020-06-30 12:12:34 +03:00
Lionell
688a9ade0d change .nil? to .blank? 2020-06-29 16:12:05 +08:00
Lionell
5f6917ae7c Merge branch 'master' into license 2020-06-28 02:07:53 +08:00
lionellloh
4d4f6a8fac audit: remove unnecessary nil assignment 2020-06-28 02:07:32 +08:00
Lionell Loh Jian An
759708fae7
Apply suggestions from code review
Code Review Changes

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-06-28 01:54:41 +08:00
Frank Lam
b2eafdf11d
Remove patch checks from audit 2020-06-27 02:37:57 +08:00
Lionell Loh Jian An
22baff39bc
Apply suggestions from code review
Applying style-related suggestions from code review

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>
2020-06-25 15:36:55 +08:00
lionellloh
0304545d0c use File.open instead of Kernel.open 2020-06-25 05:46:33 +08:00
lionellloh
3f267a8fc9 audit: fix callers to call get_repo_data only if @new_formula 2020-06-25 05:09:56 +08:00
Lionell
4832a5aa05 audit: modified problem statement to match 2020-06-24 20:43:33 +08:00
Lionell Loh Jian An
9845091f4d
Apply suggestions from code review
license: code review changes

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-06-24 18:32:53 +08:00
lionellloh
127d67e745 license: update tests and license checking logic 2020-06-23 02:59:55 +08:00
lionellloh
8d7a9d51d3 audit: rename spdx_id to spdx_data 2020-06-23 01:42:24 +08:00
Lionell
ec2391100a Merge branch 'license' of https://github.com/MLH-Fellowship/brew into license 2020-06-19 04:24:39 +08:00
Lionell
4287ea74d1 remove json from gemfile and modified get_repo_data 2020-06-19 04:20:19 +08:00
Lionell Loh Jian An
a58905000c
Update Library/Homebrew/dev-cmd/audit.rb
audit license: suppress missing license problem unless it is a new_formula

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-06-19 04:17:35 +08:00
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