Skip to content

Commit

Permalink
Strcase converts between snake_case, camelCase, kebab-case, and more!
Browse files Browse the repository at this point in the history
Good test coverage and fast

Supports:
- Unicode
- Go intialisms
- Custom split functions
- Custom delimters
- Custom initialisms
  • Loading branch information
liyanchang committed May 20, 2020
0 parents commit 60ee207
Show file tree
Hide file tree
Showing 23 changed files with 2,947 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!--
Please answer these questions before submitting your issue. Thanks!
-->

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->



### What did you expect to see?



### What did you see instead?



### What version of Go are you using (`go version && go env`)?

<pre>
$ go version

$ go env

</pre>
28 changes: 28 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Thanks for the contrbution! I really appreciate it

FYI Our goals are to keep the API simple and the code fast. If it can be done
with `ToCase` or a custom Caser, it might not be a good fit.
-->

### What does this fix or improve?



### Is this a breaking change API change or change in behavior?



### Checklist:
<!--
Put an `x` in all the boxes that you've completed.

You don't need to have everything done before opening a PR.

If you're unsure, don't hesitate to ask. Happy to help!
-->
- [ ] I have updated the documentation accordingly, if needed.
- [ ] I have added appropriate tests, if needed.


<!-- Thanks! -->
22 changes: 22 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.26

# Optional: golangci-lint command line arguments.
# args: ./the-only-dir-to-analyze/...
36 changes: 36 additions & 0 deletions .github/workflows/gotest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: go test
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
test:
strategy:
matrix:
go-version: [1.13.x, 1.14.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Test
run: go test -v -cover ./...

benchmark:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14.x
- name: Checkout code
uses: actions/checkout@v2
- name: Benchmark
run: cd benchmark && go test -bench=. -test.benchmem
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# CPU and memory profiles
*.prof

# Dependency directories
vendor/
83 changes: 83 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
linters-settings:
dupl:
threshold: 100
gocyclo:
min-complexity: 15
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- ifElseChain
- whyNoLint
- wrapperFunc
golint:
min-confidence: 0
govet:
check-shadowing: true
lll:
line-length: 140
maligned:
suggest-new: true
misspell:
locale: US
nolintlint:
allow-leading-space: false
allow-unused: false
require-specific: true

require-explanation: true
allow-no-explanation:
- gocyclo

linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- gochecknoinits
- gocritic
- gocyclo
- gofmt
- goimports
- golint
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- nolintlint
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace

# don't enable:
# - asciicheck
# - gochecknoglobals
# - gocognit
# - godot
# - godox
# - goerr113
# - maligned
# - nestif
# - prealloc
# - testpackage
# - wsl
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Liyan David Chang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 60ee207

Please sign in to comment.