Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
fbd5c32d
Commit
fbd5c32d
authored
4 years ago
by
lionellloh
Browse files
Options
Downloads
Patches
Plain Diff
bunch of style fixes
parent
2970abdc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/dev-cmd/update-license-data.rb
+24
-24
24 additions, 24 deletions
Library/Homebrew/dev-cmd/update-license-data.rb
Library/Homebrew/test/dev-cmd/audit_spec.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/test/dev-cmd/audit_spec.rb
with
25 additions
and
25 deletions
Library/Homebrew/dev-cmd/update-license-data.rb
+
24
−
24
View file @
fbd5c32d
...
...
@@ -8,37 +8,37 @@ require "json"
module
Homebrew
module_function
SPDX_FOLDER_PATH
=
(
HOMEBREW_LIBRARY_PATH
/
"data"
).
freeze
FILE_NAME
=
"spdx.json"
SPDX_DATA_URL
=
"https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json"
SPDX_FOLDER_PATH
=
(
HOMEBREW_LIBRARY_PATH
/
"data"
).
freeze
FILE_NAME
=
"spdx.json"
SPDX_DATA_URL
=
"https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json"
def
update_license_data_args
Homebrew
::
CLI
::
Parser
.
new
do
usage_banner
<<~
EOS
`update_license_data` <cmd>
def
update_license_data_args
Homebrew
::
CLI
::
Parser
.
new
do
usage_banner
<<~
EOS
`update_license_data` <cmd>
Update SPDX license data in the Homebrew repository.
EOS
switch
"--fail-if-changed"
,
description:
"Return a failing status code if current license data's version is different from
the upstream. This
"
\
"can be used to notify CI when the SPDX license data is out of date."
switch
"--fail-if-changed"
,
description:
"Return a failing status code if current license data's version is different from"
\
"
the upstream. This
can be used to notify CI when the SPDX license data is out of date."
max_named
0
end
max_named
0
end
end
def
update_license_data
update_license_data_args
.
parse
puts
"Fetching newest version of SPDX License data..."
open
(
SPDX_DATA_URL
)
do
|
json
|
File
.
open
(
SPDX_FOLDER_PATH
/
FILE_NAME
,
"wb"
)
do
|
file
|
file
.
write
(
json
.
read
)
end
end
if
args
.
fail_if_changed?
Homebrew
.
failed
=
true
system
(
"git diff --stat --exit-code
#{
FILE_NAME
}
"
)
def
update_license_data
update_license_data_args
.
parse
puts
"Fetching newest version of SPDX License data..."
File
.
open
(
SPDX_DATA_URL
)
do
|
json
|
File
.
open
(
SPDX_FOLDER_PATH
/
FILE_NAME
,
"wb"
)
do
|
file
|
file
.
write
(
json
.
read
)
end
end
return
unless
args
.
fail_if_changed?
Homebrew
.
failed
=
true
system
(
"git diff --stat --exit-code
#{
FILE_NAME
}
"
)
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/dev-cmd/audit_spec.rb
+
1
−
1
View file @
fbd5c32d
...
...
@@ -166,7 +166,7 @@ module Homebrew
RUBY
fa
.
audit_license
expect
(
fa
.
problems
).
to
be_empty
expect
(
fa
.
problems
).
to
be_empty
end
it
"checks online and detects that a formula-specified license is not "
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment