-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from liggitt/init
Initialize cobra-cli repo
- Loading branch information
Showing
18 changed files
with
1,316 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 99 | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 99 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Mark stale issues and pull requests | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
stale: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/stale@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'This issue is being marked as stale due to a long period of inactivity' | ||
stale-pr-message: 'This PR is being marked as stale due to a long period of inactivity' | ||
stale-issue-label: 'kind/stale' | ||
stale-pr-label: 'kind/stale' | ||
exempt-issue-label: 'kind/stale' | ||
exempt-pr-label: 'kind/stale' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
GO111MODULE: on | ||
|
||
jobs: | ||
|
||
golangci-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.17' | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: latest | ||
args: --verbose | ||
|
||
test-unix: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- ubuntu | ||
- macOS | ||
go: | ||
- 14 | ||
- 15 | ||
- 16 | ||
- 17 | ||
name: '${{ matrix.platform }} | 1.${{ matrix.go }}.x' | ||
runs-on: ${{ matrix.platform }}-latest | ||
steps: | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.${{ matrix.go }}.x | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-1.${{ matrix.go }}.x-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-1.${{ matrix.go }}.x- | ||
|
||
- run: | | ||
export GOBIN=$HOME/go/bin | ||
case "${{ matrix.go }}" in | ||
16|17) _version='@latest';; | ||
*) _version='';; | ||
esac | ||
go install github.com/kyoh86/richgo"${_version}" | ||
go install github.com/mitchellh/gox"${_version}" | ||
- run: PATH=$HOME/go/bin/:$PATH make test build | ||
|
||
test-win: | ||
name: MINGW64 | ||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
runs-on: windows-latest | ||
steps: | ||
|
||
- shell: bash | ||
run: git config --global core.autocrlf input | ||
|
||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: MINGW64 | ||
update: true | ||
install: > | ||
git | ||
make | ||
unzip | ||
mingw-w64-x86_64-go | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-${{ matrix.go }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-${{ matrix.go }}- | ||
|
||
- run: | | ||
export GOBIN=$HOME/go/bin | ||
go install github.com/kyoh86/richgo@latest | ||
go install github.com/mitchellh/gox@latest | ||
- run: PATH=$HOME/go/bin:$PATH make test build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
# Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore | ||
# swap | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
# session | ||
Session.vim | ||
# temporary | ||
.netrwhist | ||
*~ | ||
# auto-generated tag files | ||
tags | ||
|
||
*.exe | ||
cobra.test | ||
bin | ||
|
||
.idea/ | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
run: | ||
deadline: 5m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
#- bodyclose | ||
- deadcode | ||
#- depguard | ||
#- dogsled | ||
#- dupl | ||
- errcheck | ||
#- exhaustive | ||
#- funlen | ||
- gas | ||
#- gochecknoinits | ||
- goconst | ||
#- gocritic | ||
#- gocyclo | ||
#- gofmt | ||
- goimports | ||
- golint | ||
#- gomnd | ||
#- goprintffuncname | ||
#- gosec | ||
#- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
#- lll | ||
- maligned | ||
- megacheck | ||
#- misspell | ||
#- nakedret | ||
#- noctx | ||
#- nolintlint | ||
#- rowserrcheck | ||
#- scopelint | ||
#- staticcheck | ||
- structcheck | ||
#- stylecheck | ||
#- typecheck | ||
- unconvert | ||
#- unparam | ||
#- unused | ||
- varcheck | ||
#- whitespace | ||
fast: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Cobra User Contract | ||
|
||
### CVE | ||
Maintainers will make every effort to release security patches in the case of a medium to high severity CVE directly impacting the library. The speed in which these patches reach a release is up to the discretion of the maintainers. A low severity CVE may be a lower priority than a high severity one. | ||
|
||
### Communication | ||
Cobra maintainers will use GitHub issues and the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) as the primary means of communication with the community. This is to foster open communication with all users and contributors. | ||
|
||
### Breaking Changes | ||
Breaking changes are generally allowed in the master branch, as this is the branch used to develop the next release of Cobra. | ||
|
||
There may be times, however, when master is closed for breaking changes. This is likely to happen as we near the release of a new version. | ||
|
||
Breaking changes are not allowed in release branches, as these represent minor versions that have already been released. These version have consumers who expect the APIs, behaviors, etc, to remain stable during the lifetime of the patch stream for the minor release. | ||
|
||
Examples of breaking changes include: | ||
- Removing or renaming exported constant, variable, type, or function. | ||
- Updating the version of critical libraries such as `spf13/pflag`, `spf13/viper` etc... | ||
- Some version updates may be acceptable for picking up bug fixes, but maintainers must exercise caution when reviewing. | ||
|
||
There may, at times, need to be exceptions where breaking changes are allowed in release branches. These are at the discretion of the project's maintainers, and must be carefully considered before merging. | ||
|
||
### CI Testing | ||
Maintainers will ensure the Cobra test suite utilizes the current supported versions of Golang. | ||
|
||
### Disclaimer | ||
Changes to this document and the contents therein are at the discretion of the maintainers. | ||
None of the contents of this document are legally binding in any way to the maintainers or the users. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Contributing to Cobra | ||
|
||
Thank you so much for contributing to Cobra. We appreciate your time and help. | ||
Here are some guidelines to help you get started. | ||
|
||
## Code of Conduct | ||
|
||
Be kind and respectful to the members of the community. Take time to educate | ||
others who are seeking help. Harassment of any kind will not be tolerated. | ||
|
||
## Questions | ||
|
||
If you have questions regarding Cobra, feel free to ask it in the community | ||
[#cobra Slack channel][cobra-slack] | ||
|
||
## Filing a bug or feature | ||
|
||
1. Before filing an issue, please check the existing issues to see if a | ||
similar one was already opened. If there is one already opened, feel free | ||
to comment on it. | ||
1. If you believe you've found a bug, please provide detailed steps of | ||
reproduction, the version of Cobra and anything else you believe will be | ||
useful to help troubleshoot it (e.g. OS environment, environment variables, | ||
etc...). Also state the current behavior vs. the expected behavior. | ||
1. If you'd like to see a feature or an enhancement please open an issue with | ||
a clear title and description of what the feature is and why it would be | ||
beneficial to the project and its users. | ||
|
||
## Submitting changes | ||
|
||
1. CLA: Upon submitting a Pull Request (PR), contributors will be prompted to | ||
sign a CLA. Please sign the CLA :slightly_smiling_face: | ||
1. Tests: If you are submitting code, please ensure you have adequate tests | ||
for the feature. Tests can be run via `go test ./...` or `make test`. | ||
1. Since this is golang project, ensure the new code is properly formatted to | ||
ensure code consistency. Run `make all`. | ||
|
||
### Quick steps to contribute | ||
|
||
1. Fork the project. | ||
1. Download your fork to your PC (`git clone https://github.com/your_username/cobra-cli && cd cobra-cli`) | ||
1. Create your feature branch (`git checkout -b my-new-feature`) | ||
1. Make changes and run tests (`make test`) | ||
1. Add them to staging (`git add .`) | ||
1. Commit your changes (`git commit -m 'Add some feature'`) | ||
1. Push to the branch (`git push origin my-new-feature`) | ||
1. Create new pull request | ||
|
||
<!-- Links --> | ||
[cobra-slack]: https://gophers.slack.com/archives/CD3LP1199 |
Oops, something went wrong.