Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
abitrolly authored Nov 11, 2024
2 parents e57e4ca + 6911257 commit d8c0c4e
Show file tree
Hide file tree
Showing 29 changed files with 2,038 additions and 1,492 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# See https://help.github.com/articles/about-codeowners/
# for more info about CODEOWNERS file

* @urfave/cli
75 changes: 75 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
name: bug report
about: Create a report to help us fix bugs
title: 'your bug title goes here'
labels: 'kind/bug, status/triage'
assignees: ''

---

## My urfave/sflags version is

_**( Put the version of urfave/sflags that you are using here )**_

## Checklist

- [ ] Are you running the latest release? The list of releases is [here](https://github.com/urfave/sflags/releases).
- [ ] Did you perform a search about this problem? Here's the [GitHub guide](https://help.github.com/en/github/managing-your-work-on-github/using-search-to-filter-issues-and-pull-requests) about searching.

## Dependency Management

<!--
Delete any of the following that do not apply:
-->

- My project is using go modules.
- My project is using vendoring.
- My project is automatically downloading the latest version.
- I am unsure of what my dependency management setup is.

## Describe the bug

A clear and concise description of what the bug is.

## To reproduce

Describe the steps or code required to reproduce the behavior

## Observed behavior

What did you see happen immediately after the reproduction steps
above?

## Expected behavior

What would you have expected to happen immediately after the
reproduction steps above?

## Additional context

Add any other context about the problem here.

If the issue relates to a specific open source GitHub repo, please
link that repo here.

If you can reproduce this issue with a public CI system, please
link a failing build here.

## Want to fix this yourself?

We'd love to have more contributors on this project! If the fix for
this bug is easily explained and very small, feel free to create a
pull request for it. You'll want to base the PR off the `v1`
branch, all `v1` bug fix releases will be made from that branch.

## Run `go version` and paste its output here

```
# paste `go version` output in here
```

## Run `go env` and paste its output here

```
# paste `go env` output in here
```
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: feature request
about: Suggest an improvement to go into sflags
title: 'your feature title goes here'
labels: 'type/feature, status/triage'
assignees: ''

---

## Checklist

* [ ] Are you running the latest v3 release? The list of releases is [here](https://github.com/urfave/sflags/releases).
* [ ] Did you perform a search about this feature? Here's the [GitHub guide](https://help.github.com/en/github/managing-your-work-on-github/using-search-to-filter-issues-and-pull-requests) about searching.

## What problem does this solve?

A clear and concise description of what problem this feature would solve. For example:

- needing to type out the full flag name takes a long time, so I
would like to suggest adding auto-complete
- I use (osx, windows, linux) and would like support for (some
existing feature) to be extended to my platform
- the terminal output for a particular error case is confusing, and
I think it could be improved

## Solution description

A detailed description of what you want to happen.

## Describe alternatives you've considered

A clear and concise description of any alternative solutions or
features you've considered.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: ask a question
about: ask a question - assume stackoverflow's guidelines apply here
title: your question title goes here
labels: 'kind/question, status/triage'
assignees: ''

---

my question is...
12 changes: 12 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
comment: false
coverage:
status:
project:
default:
threshold: 5%
patch:
default:
threshold: 5%
ignore:
- examples
- scripts
75 changes: 75 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!--
This template provides some ideas of things to include in your PR description.
To start, try providing a short summary of your changes in the Title above.
If a section of the PR template does not apply to this PR, then delete that section.
-->

## What type of PR is this?

_(REQUIRED)_

<!--
Delete any of the following that do not apply:
-->

- bug
- cleanup
- documentation
- feature

## What this PR does / why we need it:

_(REQUIRED)_

<!--
What goal is this change working towards?
Provide a bullet pointed summary of how each file was changed.
Briefly explain any decisions you made with respect to the changes.
Include anything here that you didn't include in *Release Notes*
above, such as changes to CI or changes to internal methods.
-->

## Which issue(s) this PR fixes:

_(REQUIRED)_

<!--
If this PR fixes one of more issues, list them here.
One line each, like so:
Fixes #123
Fixes #39
-->

## Special notes for your reviewer:

_(fill-in or delete this section)_

<!--
Is there any particular feedback you would / wouldn't like?
Which parts of the code should reviewers focus on?
-->

## Testing

_(fill-in or delete this section)_

<!--
Describe how you tested this change.
-->

## Release Notes

_(REQUIRED)_
<!--
If this PR makes user facing changes, please describe them here. This
description will be copied into the release notes/changelog, whenever the
next version is released. Keep this section short, and focus on high level
changes.
Put your text between the block. To omit notes, use NONE within the block.
-->

```release-note
```
33 changes: 33 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
strategy:
matrix:
go: [stable]
# disable windows-latest for now
os: [ubuntu-latest, macos-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
- name: run CI
run: make ci
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run tests

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: [stable, oldstable]

name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Set PATH
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"

- name: Run tests
run: make test_v
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PKGSDIRS=$(shell find -L . -type f -name "*.go")

all: prepare

travis: info vet lint check test_v coverage
ci: vet check test_v coverage

coverage:
@echo "$(OK_COLOR)Generate coverage$(NO_COLOR)"
Expand All @@ -30,7 +30,7 @@ lint:

check:
@echo "$(OK_COLOR)Run golangci-lint$(NO_COLOR)"
@golangci-lint run --no-config --exclude-use-default=true --max-same-issues=10 --disable=gosimple --disable=golint --enable=megacheck --enable=interfacer --enable=goconst --enable=misspell --enable=unparam --enable=goimports --disable=errcheck --disable=ineffassign --disable=gocyclo --disable=gas
@golangci-lint run --no-config --exclude-use-default=true --max-same-issues=10 --disable=gosimple --enable=staticcheck --enable=unused --enable=goconst --enable=misspell --enable=unparam --enable=goimports --disable=errcheck --disable=ineffassign --disable=gocyclo --disable=gosec

vet:
@echo "$(OK_COLOR)Run vet$(NO_COLOR)"
Expand All @@ -42,7 +42,7 @@ race:

fmt:
@echo "$(OK_COLOR)Formatting$(NO_COLOR)"
@echo $(PKGSDIRS) | xargs -I '{p}' -n1 goimports -w {p}
@echo $(PKGSDIRS) | xargs goimports -w

info:
depscheck -totalonly -tests .
Expand All @@ -57,5 +57,5 @@ tools:
go get -u github.com/warmans/golocc
go get -u github.com/divan/depscheck
GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
cd ${GOPATH}/src/github.com/golangci/golangci-lint/cmd/golangci-lint
go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'"
cd ${GOPATH}/src/github.com/golangci/golangci-lint/cmd/golangci-lint \
&& go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Field int `flag:",deprecated"`
If you specify description in description tag (`desc` by default) it will be used in USAGE section.

```
Addr string `desc:"HTTP address"`
Addr string `desc:"HTTP host"`
```
this description produces something like:
```
Expand Down
48 changes: 24 additions & 24 deletions camelcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,37 @@ const (
//
// Examples
//
// "" => [""]
// "lowercase" => ["lowercase"]
// "Class" => ["Class"]
// "MyClass" => ["My", "Class"]
// "MyC" => ["My", "C"]
// "HTML" => ["HTML"]
// "PDFLoader" => ["PDF", "Loader"]
// "AString" => ["A", "String"]
// "SimpleXMLParser" => ["Simple", "XML", "Parser"]
// "vimRPCPlugin" => ["vim", "RPC", "Plugin"]
// "GL11Version" => ["GL11", "Version"]
// "99Bottles" => ["99", "Bottles"]
// "May5" => ["May5"]
// "BFG9000" => ["BFG9000"]
// "BöseÜberraschung" => ["Böse", "Überraschung"]
// "Two spaces" => ["Two", " ", "spaces"]
// "BadUTF8\xe2\xe2\xa1" => ["BadUTF8\xe2\xe2\xa1"]
// "" => [""]
// "lowercase" => ["lowercase"]
// "Class" => ["Class"]
// "MyClass" => ["My", "Class"]
// "MyC" => ["My", "C"]
// "HTML" => ["HTML"]
// "PDFLoader" => ["PDF", "Loader"]
// "AString" => ["A", "String"]
// "SimpleXMLParser" => ["Simple", "XML", "Parser"]
// "vimRPCPlugin" => ["vim", "RPC", "Plugin"]
// "GL11Version" => ["GL11", "Version"]
// "99Bottles" => ["99", "Bottles"]
// "May5" => ["May5"]
// "BFG9000" => ["BFG9000"]
// "BöseÜberraschung" => ["Böse", "Überraschung"]
// "Two spaces" => ["Two", " ", "spaces"]
// "BadUTF8\xe2\xe2\xa1" => ["BadUTF8\xe2\xe2\xa1"]
//
// Splitting rules
//
// 1) If string is not valid UTF-8, return it without splitting as
// 1. If string is not valid UTF-8, return it without splitting as
// single item array.
// 2) Assign all unicode characters into one of 4 sets: lower case
// 2. Assign all unicode characters into one of 4 sets: lower case
// letters, upper case letters, numbers, and all other characters.
// 3) Iterate through characters of string, introducing splits
// 3. Iterate through characters of string, introducing splits
// between adjacent characters that belong to different sets.
// 4) Iterate through array of split strings, and if a given string
// 4. Iterate through array of split strings, and if a given string
// is upper case:
// if subsequent string is lower case:
// move last character of upper case string to beginning of
// lower case string
// if subsequent string is lower case:
// move last character of upper case string to beginning of
// lower case string
func split(src string) (entries []string) {
// don't split invalid utf8
if !utf8.ValidString(src) {
Expand Down
Loading

0 comments on commit d8c0c4e

Please sign in to comment.