-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract komplete into its own repository
This library was developed in [git-spice](https://github.com/abhinav/git-spice), specifically with plans to extract and open source separately under a different license.
- Loading branch information
Showing
13 changed files
with
258 additions
and
13 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,6 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), | ||
and is generated by [Changie](https://github.com/miniscruff/changie). |
Empty file.
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,26 @@ | ||
changesDir: .changes | ||
unreleasedDir: unreleased | ||
headerPath: header.tpl.md | ||
changelogPath: CHANGELOG.md | ||
versionExt: md | ||
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}' | ||
kindFormat: '### {{.Kind}}' | ||
changeFormat: '- {{.Body}}' | ||
kinds: | ||
- label: Added | ||
auto: minor | ||
- label: Changed | ||
auto: major | ||
- label: Deprecated | ||
auto: minor | ||
- label: Removed | ||
auto: major | ||
- label: Fixed | ||
auto: patch | ||
- label: Security | ||
auto: patch | ||
newlines: | ||
afterChangelogHeader: 0 | ||
beforeChangelogVersion: 1 | ||
endOfVersion: 1 | ||
envPrefix: CHANGIE_ |
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,46 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ '*' ] | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out repository | ||
- uses: actions/setup-go@v5 | ||
name: Set up Go | ||
with: | ||
go-version: stable | ||
cache: false | ||
- uses: golangci/golangci-lint-action@v6 | ||
name: Install golangci-lint | ||
with: | ||
version: latest | ||
args: --help | ||
- run: make lint | ||
name: Lint | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ["1.22.x", "1.23.x"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
cache: true | ||
- name: Test | ||
run: make cover | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v4 |
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,66 @@ | ||
name: Publish documentation | ||
|
||
on: | ||
# Publish documentation when a new release is tagged. | ||
push: | ||
tags: ['v*'] | ||
|
||
# Allow manually publishing documentation from a specific hash. | ||
workflow_dispatch: | ||
inputs: | ||
head: | ||
description: "Git commit to publish documentation for." | ||
required: true | ||
type: string | ||
|
||
# If two concurrent runs are started, | ||
# prefer the latest one. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build website | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Check out head specified by workflow_dispatch, | ||
# or the tag if this fired from the push event. | ||
ref: ${{ inputs.head || github.ref }} | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
cache: true | ||
- name: Install doc2go | ||
run: go install go.abhg.dev/doc2go@latest | ||
- name: Generate API reference | ||
run: doc2go -home go.abhg.dev/komplete ./... | ||
- name: Upload pages | ||
uses: actions/upload-pages-artifact@v3 | ||
|
||
publish: | ||
name: Publish website | ||
# Don't run until the build has finished running. | ||
needs: build | ||
|
||
# Grants the GITHUB_TOKEN used by this job | ||
# permissions needed to publish the website. | ||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
# Deploy to the github-pages environment | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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,9 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), | ||
and is generated by [Changie](https://github.com/miniscruff/changie). | ||
|
||
|
||
No releases yet, this file will be updated when generating your first release. |
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,41 @@ | ||
SHELL = /bin/bash | ||
|
||
PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
# Setting GOBIN and PATH ensures two things: | ||
# - All 'go install' commands we run | ||
# only affect the current directory. | ||
# - All installed tools are available on PATH | ||
# for commands like go generate. | ||
export GOBIN = $(PROJECT_ROOT)/bin | ||
export PATH := $(GOBIN):$(PATH) | ||
|
||
TEST_FLAGS ?= -race | ||
|
||
.PHONY: all | ||
all: build lint test | ||
|
||
.PHONY: build | ||
build: | ||
go build ./... | ||
|
||
.PHONY: lint | ||
lint: golangci-lint tidy-lint | ||
|
||
.PHONY: test | ||
test: | ||
go test $(TEST_FLAGS) ./... | ||
|
||
.PHONY: cover | ||
cover: | ||
go test $(TEST_FLAGS) -coverprofile=cover.out -coverpkg=./... ./... | ||
go tool cover -html=cover.out -o cover.html | ||
|
||
.PHONY: tidy-lint | ||
tidy-lint: | ||
go mod tidy -diff | ||
|
||
.PHONY: golangci-lint | ||
golangci-lint: | ||
golangci-lint run | ||
|
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
This directory provides komplete, a command-line completion engine for Kong. | ||
The source code in this directory is made available under the BSD3 license. | ||
[![Go Reference](https://pkg.go.dev/badge/go.abhg.dev/komplete.svg)](https://pkg.go.dev/go.abhg.dev/komplete) | ||
[![CI](https://github.com/abhinav/komplete/actions/workflows/ci.yml/badge.svg)](https://github.com/abhinav/komplete/actions/workflows/ci.yml) | ||
|
||
komplete is a command-line completion engine for the | ||
[Kong CLI parser](https://github.com/alecthomas/kong) | ||
See [API Reference](https://abhinav.github.io/komplete/) for usage information. | ||
|
||
This software is made available under the BSD-3 license. | ||
See LICENSE for the full license text. |
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,15 @@ | ||
module go.abhg.dev/komplete | ||
|
||
go 1.22 | ||
|
||
require ( | ||
github.com/alecthomas/kong v1.2.1 | ||
github.com/buildkite/shellwords v0.0.0-20180315110454-59467a9b8e10 | ||
github.com/stretchr/testify v1.9.0 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
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,20 @@ | ||
github.com/alecthomas/assert/v2 v2.10.0 h1:jjRCHsj6hBJhkmhznrCzoNpbA3zqy0fYiUcYZP/GkPY= | ||
github.com/alecthomas/assert/v2 v2.10.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= | ||
github.com/alecthomas/kong v1.2.1 h1:E8jH4Tsgv6wCRX2nGrdPyHDUCSG83WH2qE4XLACD33Q= | ||
github.com/alecthomas/kong v1.2.1/go.mod h1:rKTSFhbdp3Ryefn8x5MOEprnRFQ7nlmMC01GKhehhBM= | ||
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= | ||
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= | ||
github.com/buildkite/shellwords v0.0.0-20180315110454-59467a9b8e10 h1:XwHQ5xDtYPdtBbVPyRO6UZoWZe8/mbKUb076f8x7RvI= | ||
github.com/buildkite/shellwords v0.0.0-20180315110454-59467a9b8e10/go.mod h1:gv0DYOzHEsKgo31lTCDGauIg4DTTGn41Bzp+t3wSOlk= | ||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= | ||
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= | ||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
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
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
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,6 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"local>abhinav/renovate-config" | ||
] | ||
} |