Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: WillAbides/setup-go-faster@v1
id: setup-go
with:
go-version: '1.21.x'
go-version: '1.23.5'
- uses: actions/cache@v3
with:
path: |
Expand All @@ -43,7 +43,7 @@ jobs:
- uses: WillAbides/setup-go-faster@v1
id: setup-go
with:
go-version: '1.21.x'
go-version: '1.23.5'
- uses: actions/cache@v3
with:
path: |
Expand All @@ -61,7 +61,7 @@ jobs:
- uses: WillAbides/setup-go-faster@v1
id: setup-go
with:
go-version: '1.21.x'
go-version: '1.23.5'
- name: configure git
run: |
git config --global user.name 'github-actions[bot]'
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
- uses: WillAbides/setup-go-faster@v1
id: setup-go
with:
go-version: '1.21.x'
go-version: '1.23.5'
- uses: actions/cache@v3
with:
path: |
Expand Down
48 changes: 40 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,52 @@ linters-settings:
- style
- diagnostic
- performance
- opinionated
- experimental
disabled-checks:
- rangeValCopy
- ptrToRefParam
- hugeParam
govet:
enable-all: true
disable:
- fieldalignment
errcheck:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
govet:
# report about shadowed variables
check-shadowing: true
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
check-type-assertions: true
revive:
rules:
- name: package-comments
disabled: true
# default rules:
- name: var-declaration
- name: dot-imports
- name: blank-imports
- name: indent-error-flow
- name: range
- name: errorf
- name: error-naming
- name: receiver-naming
- name: increment-decrement
- name: error-return
- name: unexported-return
- name: time-naming
- name: context-keys-type
- name: context-as-argument
- name: empty-block
- name: superfluous-else
- name: unused-parameter
- name: unreachable-code
- name: redefines-builtin-id

# extra rules:
- name: atomic
- name: bare-return
- name: bool-literal-in-expr
- name: comment-spacings
- name: constant-logical-expr
- name: datarace
- name: deep-exit
- name: defer
- name: early-return
- name: import-shadowing
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ overrides:
<!--- everything between the next line and the "end usage output" comment is generated by script/generate-readme --->
<!--- start usage output --->
```
Usage: bindown <command>
Usage: bindown <command> [flags]

Flags:
-h, --help Show context-sensitive help.
Expand Down
76 changes: 27 additions & 49 deletions bindown.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
"description": "Whether to create a symlink to the bin instead of copying it."
},
"vars": {
"patternProperties": {
".*": {
"type": "string"
}
"additionalProperties": {
"type": "string"
},
"type": "object",
"description": "A list of variables that can be used in 'url', 'archive_path' and 'bin'.\n\nTwo variables are always added based on the current environment: 'os' and 'arch'. Those are the operating\nsystem and architecture as defined by go's GOOS and GOARCH variables. I should document what those are\nsomewhere.\n\nYou can reference a variable using golang template syntax. For example, you could have a url set to\n`https://example.org/mydependency/v{{.version}}/mydependency-{{.os}}-{{.arch}}.tar.gz`. If you define the var\n'version: 1.2.3' and run bindown on a 64-bit Linux system, it will download\n`https://example.org/mydependency/v1.2.3/mydependency-linux-amd64.tar.gz`."
Expand All @@ -49,15 +47,11 @@
"description": "Overrides allows you to override values depending on the os and architecture of the target system."
},
"substitutions": {
"patternProperties": {
".*": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
}
"additionalProperties": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"type": "object",
"description": "Substitutions will substitute values from vars. The key is the name of the variable to substitute. The value is\na map of substitutions. { \"os\": { \"linux\": \"Linux\", \"darwin\": \"MacOS\" } } is an example of a substitution that\nwill update the os variable."
Expand All @@ -83,13 +77,11 @@
"DependencyOverride": {
"properties": {
"matcher": {
"patternProperties": {
".*": {
"items": {
"type": "string"
},
"type": "array"
}
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"type": "object",
"description": "Limits the override to configurations matching all of the matchers. Keys may be \"os\", \"arch\" or any variable name.\nValues are an array of values to match. Any matching value will match. If a value can be interpreted as a\nsemantic version it will be treated as such."
Expand Down Expand Up @@ -125,10 +117,8 @@
"description": "Whether to create a symlink to the bin instead of copying it."
},
"vars": {
"patternProperties": {
".*": {
"type": "string"
}
"additionalProperties": {
"type": "string"
},
"type": "object",
"description": "A list of variables that can be used in 'url', 'archive_path' and 'bin'.\n\nTwo variables are always added based on the current environment: 'os' and 'arch'. Those are the operating\nsystem and architecture as defined by go's GOOS and GOARCH variables. I should document what those are\nsomewhere.\n\nYou can reference a variable using golang template syntax. For example, you could have a url set to\n`https://example.org/mydependency/v{{.version}}/mydependency-{{.os}}-{{.arch}}.tar.gz`. If you define the var\n'version: 1.2.3' and run bindown on a 64-bit Linux system, it will download\n`https://example.org/mydependency/v1.2.3/mydependency-linux-amd64.tar.gz`."
Expand All @@ -141,15 +131,11 @@
"description": "Overrides allows you to override values depending on the os and architecture of the target system."
},
"substitutions": {
"patternProperties": {
".*": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
}
"additionalProperties": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"type": "object",
"description": "Substitutions will substitute values from vars. The key is the name of the variable to substitute. The value is\na map of substitutions. { \"os\": { \"linux\": \"Linux\", \"darwin\": \"MacOS\" } } is an example of a substitution that\nwill update the os variable."
Expand All @@ -176,37 +162,29 @@
"description": "List of systems supported by this config. Systems are in the form of os/architecture."
},
"dependencies": {
"patternProperties": {
".*": {
"$ref": "#/$defs/Dependency"
}
"additionalProperties": {
"$ref": "#/$defs/Dependency"
},
"type": "object",
"description": "Dependencies available for bindown to install."
},
"templates": {
"patternProperties": {
".*": {
"$ref": "#/$defs/Dependency"
}
"additionalProperties": {
"$ref": "#/$defs/Dependency"
},
"type": "object",
"description": "Templates that can be used by dependencies in this file."
},
"template_sources": {
"patternProperties": {
".*": {
"type": "string"
}
"additionalProperties": {
"type": "string"
},
"type": "object",
"description": "Upstream sources for templates."
},
"url_checksums": {
"patternProperties": {
".*": {
"type": "string"
}
"additionalProperties": {
"type": "string"
},
"type": "object",
"description": "Checksums of downloaded files."
Expand Down
59 changes: 24 additions & 35 deletions bindown.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ $defs:
type: boolean
description: Whether to create a symlink to the bin instead of copying it.
vars:
patternProperties:
.*:
type: string
additionalProperties:
type: string
type: object
description: |-
A list of variables that can be used in 'url', 'archive_path' and 'bin'.
Expand All @@ -50,12 +49,10 @@ $defs:
type: array
description: Overrides allows you to override values depending on the os and architecture of the target system.
substitutions:
patternProperties:
.*:
patternProperties:
.*:
type: string
type: object
additionalProperties:
additionalProperties:
type: string
type: object
type: object
description: |-
Substitutions will substitute values from vars. The key is the name of the variable to substitute. The value is
Expand All @@ -76,11 +73,10 @@ $defs:
DependencyOverride:
properties:
matcher:
patternProperties:
.*:
items:
type: string
type: array
additionalProperties:
items:
type: string
type: array
type: object
description: |-
Limits the override to configurations matching all of the matchers. Keys may be "os", "arch" or any variable name.
Expand Down Expand Up @@ -109,9 +105,8 @@ $defs:
type: boolean
description: Whether to create a symlink to the bin instead of copying it.
vars:
patternProperties:
.*:
type: string
additionalProperties:
type: string
type: object
description: |-
A list of variables that can be used in 'url', 'archive_path' and 'bin'.
Expand All @@ -130,12 +125,10 @@ $defs:
type: array
description: Overrides allows you to override values depending on the os and architecture of the target system.
substitutions:
patternProperties:
.*:
patternProperties:
.*:
type: string
type: object
additionalProperties:
additionalProperties:
type: string
type: object
type: object
description: |-
Substitutions will substitute values from vars. The key is the name of the variable to substitute. The value is
Expand All @@ -162,27 +155,23 @@ properties:
type: array
description: List of systems supported by this config. Systems are in the form of os/architecture.
dependencies:
patternProperties:
.*:
$ref: '#/$defs/Dependency'
additionalProperties:
$ref: '#/$defs/Dependency'
type: object
description: Dependencies available for bindown to install.
templates:
patternProperties:
.*:
$ref: '#/$defs/Dependency'
additionalProperties:
$ref: '#/$defs/Dependency'
type: object
description: Templates that can be used by dependencies in this file.
template_sources:
patternProperties:
.*:
type: string
additionalProperties:
type: string
type: object
description: Upstream sources for templates.
url_checksums:
patternProperties:
.*:
type: string
additionalProperties:
type: string
type: object
description: Checksums of downloaded files.
additionalProperties: false
Expand Down
10 changes: 5 additions & 5 deletions bindown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
golangci-lint:
template: origin#golangci-lint
vars:
version: 1.54.2
version: 1.63.4
goreleaser:
template: origin#goreleaser
vars:
Expand Down Expand Up @@ -328,10 +328,10 @@ url_checksums:
https://github.com/cli/cli/releases/download/v2.30.0/gh_2.30.0_macOS_amd64.zip: 6b91c446586935de0e9df82da58309b2d1b83061cfcd4cc173124270f1277ca7
https://github.com/cli/cli/releases/download/v2.30.0/gh_2.30.0_macOS_arm64.zip: 32a71652367f3cf664894456e4c4f655faa95964d71cc3a449fbf64bdce1fff1
https://github.com/cli/cli/releases/download/v2.30.0/gh_2.30.0_windows_amd64.zip: 7d466686978e3c93e1a412229a77921288862cec183e94ad06cd36bfcd34ebaf
https://github.com/golangci/golangci-lint/releases/download/v1.54.2/golangci-lint-1.54.2-darwin-amd64.tar.gz: 925c4097eae9e035b0b052a66d0a149f861e2ab611a4e677c7ffd2d4e05b9b89
https://github.com/golangci/golangci-lint/releases/download/v1.54.2/golangci-lint-1.54.2-darwin-arm64.tar.gz: 7b33fb1be2f26b7e3d1f3c10ce9b2b5ce6d13bb1d8468a4b2ba794f05b4445e1
https://github.com/golangci/golangci-lint/releases/download/v1.54.2/golangci-lint-1.54.2-linux-amd64.tar.gz: 17c9ca05253efe833d47f38caf670aad2202b5e6515879a99873fabd4c7452b3
https://github.com/golangci/golangci-lint/releases/download/v1.54.2/golangci-lint-1.54.2-windows-amd64.zip: ce17d122f3f93e0a9e52009d2c03cc1c1a1ae28338c2702a1f53eccd10a1afa3
https://github.com/golangci/golangci-lint/releases/download/v1.63.4/golangci-lint-1.63.4-darwin-amd64.tar.gz: 878d017cc360e4fb19510d39852c8189852e3c48e7ce0337577df73507c97d68
https://github.com/golangci/golangci-lint/releases/download/v1.63.4/golangci-lint-1.63.4-darwin-arm64.tar.gz: a2b630c2ac8466393f0ccbbede4462387b6c190697a70bc2298c6d2123f21bbf
https://github.com/golangci/golangci-lint/releases/download/v1.63.4/golangci-lint-1.63.4-linux-amd64.tar.gz: 01abb14a4df47b5ca585eff3c34b105023cba92ec34ff17212dbb83855581690
https://github.com/golangci/golangci-lint/releases/download/v1.63.4/golangci-lint-1.63.4-windows-amd64.zip: 184d13c2b8f5441576bec2a0d8ba7b2d45445595cf796b879a73bcc98c39f8c1
https://github.com/goreleaser/goreleaser/releases/download/v1.18.2/goreleaser_Darwin_arm64.tar.gz: 7eec9f4d0b86b2c9c9f6af1770a11315998bd4d4617633b0a73eeb036e97393e
https://github.com/goreleaser/goreleaser/releases/download/v1.18.2/goreleaser_Darwin_x86_64.tar.gz: 95338eed333347152e23837b68a8c6ce0c62b9f5abb68bd5b4b08178766400b9
https://github.com/goreleaser/goreleaser/releases/download/v1.18.2/goreleaser_Linux_x86_64.tar.gz: 811e0c63e347f78f3c8612a19ca8eeb564eb45f0265ce3f38aec39c8fdbcfa10
Expand Down
2 changes: 1 addition & 1 deletion cmd/bindown/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *bootstrapCmd) Run(ctx *runContext) error {
return err
}
if c.Output == "" {
fmt.Fprint(ctx.stdout, content)
mustPrint(ctx.stdout, content)
return nil
}
err = os.MkdirAll(filepath.Dir(c.Output), 0o755)
Expand Down
Loading