Skip to content

Commit

Permalink
Merge pull request #57 from embik/conventional-commits
Browse files Browse the repository at this point in the history
Add DCO and conventional commits
  • Loading branch information
embik authored May 15, 2024
2 parents c1844a8 + 05594c9 commit 1c97761
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .conform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
policies:
- type: commit
spec:
header:
length: 89
imperative: true
case: lower
invalidLastCharacters: .
dco: true
spellcheck:
locale: US
conventional:
types:
# build system, releases
- "build"
# changes with no functional effect (e.g. updating dependencies)
- "chore"
# GitHub Actions
- "ci"
# Documentation
- "docs"
# Unit and integration tests
- "test"
scopes:
# everything related to cargo configuration and dependencies
- "cargo"
# all current subcommands in kbs
- "import"
- "label"
- "list"
- "move"
- "prune"
- "remove"
- "shell"
- "use"
- "version"
descriptionLength: 72
24 changes: 24 additions & 0 deletions .github/workflows/conform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Commit Conformance
on:
pull_request:
branches: ["main"]

jobs:
signoff:
runs-on: ubuntu-latest

if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup main branch without switching current branch
run: git fetch origin main:main

- name: Conform Action
uses: siderolabs/[email protected]
with:
args: "enforce --base-branch=main"
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Contributing

Thank you for considering to contribute to kubeconfig-bikeshed! Please see the following information regarding contributions.

## License

kubeconfig-bikeshed is licensed under [Apache-2.0](./LICENSE).

## Developer Certificate of Origin (DCO)

By contributing to kubeconfig-bikeshed you agree to the Developer Certificate of Origin (DCO), which has originally been created by the Linux Foundation for the Linux kernel developer community. It certifies that you have a legal right to ma.

To sign your work, just add a line like this at the end of your commit message (this can also be done with the `--signoff` / `-S` flag):

```
Signed-off-by: Joe Example <[email protected]>
```

By doing so you certify that you make a contribution in accordance with the [DCO](./DCO) file in this repository.

## Conventional Commits

This repository uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) starting from May 25, 2024. [sidero/conform](https://github.com/siderolabs/conform) is used to validate and enforce it.

It is possible to set up a commit hook to run `conform` on commits. This is not necessary to contribute as conventional commits can be verified with any compatible tool.

```sh
cat <<EOF | tee .git/hooks/commit-msg
#!/bin/sh
conform enforce --commit-msg-file \$1
EOF
chmod +x .git/hooks/commit-msg
```
34 changes: 34 additions & 0 deletions DCO
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ Existing label values can only be updated if `--overwrite` is set, mimicking `ku

By default, this command runs in "dry mode", which means it will not delete any kubeconfigs (as this is a destructive action potentially elevated by temporary networking problems). To actually prune kubeconfigs, pass `--dry-run=false` to the command.

## Contributing

If you are interested in contributing to `kbs` please check out the [contribution guidelines](./CONTRIBUTING.md).

## Alternatives

- [konf-go](https://github.com/SimonTheLeg/konf-go) by my colleague Simon, if you are looking for a more mature solution written in Go.
Expand Down

0 comments on commit 1c97761

Please sign in to comment.