Skip to content

Commit 93878b5

Browse files
committed
Initial commit
0 parents  commit 93878b5

58 files changed

Lines changed: 2517 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.all-contributorsrc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"files": [
3+
"README.md"
4+
],
5+
"imageSize": 100,
6+
"commit": false,
7+
"badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg)](#contributors)",
8+
"contributors": [
9+
{
10+
"login": "moul",
11+
"name": "Manfred Touron",
12+
"avatar_url": "https://avatars1.githubusercontent.com/u/94029?v=4",
13+
"profile": "http://manfred.life",
14+
"contributions": [
15+
"maintenance",
16+
"doc",
17+
"test",
18+
"code"
19+
]
20+
},
21+
{
22+
"login": "moul-bot",
23+
"name": "moul-bot",
24+
"avatar_url": "https://avatars1.githubusercontent.com/u/41326314?v=4",
25+
"profile": "https://manfred.life/moul-bot",
26+
"contributions": [
27+
"maintenance"
28+
]
29+
}
30+
],
31+
"contributorsPerLine": 7,
32+
"projectName": "golang-repo-template",
33+
"projectOwner": "moul",
34+
"repoType": "github",
35+
"repoHost": "https://github.com",
36+
"skipCi": true
37+
}

.dockerignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
##
2+
## Specific to .dockerignore
3+
##
4+
5+
.git/
6+
Dockerfile
7+
contrib/
8+
9+
##
10+
## Common with .gitignore
11+
##
12+
13+
# Temporary files
14+
*~
15+
*#
16+
.#*
17+
18+
# Vendors
19+
node_modules/
20+
vendor/
21+
22+
# Binaries for programs and plugins
23+
dist/
24+
gin-bin
25+
*.exe
26+
*.exe~
27+
*.dll
28+
*.so
29+
*.dylib
30+
31+
# Test binary, build with `go test -c`
32+
*.test
33+
34+
# Output of the go coverage tool, specifically when used with LiteIDE
35+
*.out

.editorconfig

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.mod]
14+
indent_style = tab
15+
16+
[{Makefile,**.mk}]
17+
indent_style = tab
18+
19+
[*.go]
20+
indent_style = tab
21+
22+
[*.css]
23+
indent_size = 2
24+
25+
[*.proto]
26+
indent_size = 2
27+
28+
[*.ftl]
29+
indent_size = 2
30+
31+
[*.toml]
32+
indent_size = 2
33+
34+
[*.swift]
35+
indent_size = 4
36+
37+
[*.tmpl]
38+
indent_size = 2
39+
40+
[*.js]
41+
indent_size = 2
42+
block_comment_start = /*
43+
block_comment_end = */
44+
45+
[*.{html,htm}]
46+
indent_size = 2
47+
48+
[*.bat]
49+
end_of_line = crlf
50+
51+
[*.{yml,yaml}]
52+
indent_size = 2
53+
54+
[*.json]
55+
indent_size = 2
56+
57+
[.{babelrc,eslintrc,prettierrc}]
58+
indent_size = 2
59+
60+
[{Fastfile,.buckconfig,BUCK}]
61+
indent_size = 2
62+
63+
[*.diff]
64+
indent_size = 1
65+
66+
[*.m]
67+
indent_size = 1
68+
indent_style = space
69+
block_comment_start = /**
70+
block_comment = *
71+
block_comment_end = */
72+
73+
[*.java]
74+
indent_size = 4
75+
indent_style = space
76+
block_comment_start = /**
77+
block_comment = *
78+
block_comment_end = */

.gitattributes

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Collapse generated and vendored files on GitHub
5+
AUTHORS linguist-generated merge=union
6+
*.gen.* linguist-generated merge=ours
7+
*.pb.go linguist-generated merge=ours
8+
*.pb.gw.go linguist-generated merge=ours
9+
go.sum linguist-generated merge=ours
10+
go.mod linguist-generated
11+
gen.sum linguist-generated merge=ours
12+
depaware.txt linguist-generated linguist-vendored merge=union
13+
vendor/* linguist-vendored
14+
rules.mk linguist-vendored
15+
*/vendor/* linguist-vendored
16+
17+
# doc
18+
docs/* linguist-documentation
19+
docs/Makefile linguist-documentation=false
20+
21+
# Reduce conflicts on markdown files
22+
*.md merge=union
23+
24+
# A set of files you probably don't want in distribution
25+
/.github export-ignore
26+
/.githooks export-ignore
27+
.gitattributes export-ignore
28+
.gitignore export-ignore
29+
.gitmodules export-ignore
30+
/tool/lint export-ignore

.githooks/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
run-parts ./githooks/pre-commit.d/ -v --exit-on-error

.githooks/pre-commit.d/generate

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
make generate

.githooks/pre-commit.d/lint

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
STAGED_GO_FILES=$(git diff --cached --name-only | grep "\.go$")
4+
5+
if [[ "$STAGED_GO_FILES" = "" ]]; then
6+
exit 0
7+
fi
8+
9+
GOLINT=$GOPATH/bin/golint
10+
GOIMPORTS=$GOPATH/bin/goimports
11+
PASS=true
12+
13+
# Check for golint
14+
if [[ ! -x "$GOLINT" ]]; then
15+
printf "\t\033[41mPlease install golint\033[0m (go get -u golang.org/x/lint/golint)\n"
16+
PASS=false
17+
fi
18+
19+
# Check for goimports
20+
if [[ ! -x "$GOIMPORTS" ]]; then
21+
printf "\t\033[41mPlease install goimports\033[0m (go get golang.org/x/tools/cmd/goimports)\n"
22+
PASS=false
23+
fi
24+
25+
if ! $PASS; then
26+
exit 1
27+
fi
28+
29+
PASS=true
30+
31+
for FILE in $STAGED_GO_FILES
32+
do
33+
# Run goimports on the staged file
34+
$GOIMPORTS -w $FILE
35+
36+
# Run golint on the staged file and check the exit status
37+
$GOLINT "-set_exit_status" $FILE
38+
if [[ $? == 1 ]]; then
39+
printf "\t\033[31mgolint $FILE\033[0m \033[0;30m\033[41mFAILURE!\033[0m\n"
40+
PASS=false
41+
else
42+
printf "\t\033[32mgolint $FILE\033[0m \033[0;30m\033[42mpass\033[0m\n"
43+
fi
44+
done
45+
46+
if ! $PASS; then
47+
printf "\033[0;30m\033[41mCOMMIT FAILED\033[0m\n"
48+
exit 1
49+
else
50+
printf "\033[0;30m\033[42mCOMMIT SUCCEEDED\033[0m\n"
51+
fi
52+
53+
exit 0

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @moul

.github/CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at m+coc-report@42.am. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

.github/CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Contributing
2+
3+
When contributing to this repository, you can first discuss the change you wish to make via issue,
4+
email, or any other method with the maintainers of this repository before making a change.
5+
6+
Please note we have a code of conduct, please follow it in all your interactions with the project.

0 commit comments

Comments
 (0)