Skip to content

Commit 788233b

Browse files
authored
Initial commit
0 parents  commit 788233b

File tree

12 files changed

+371
-0
lines changed

12 files changed

+371
-0
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: gocron
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
# Maintain dependencies for GitHub Actions
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
14+
# Maintain Go dependencies
15+
- package-ecosystem: "gomod"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
branches-ignore:
18+
- "dependabot/**"
19+
pull_request:
20+
paths-ignore:
21+
- '**.md'
22+
# The branches below must be a subset of the branches above
23+
branches: [ main ]
24+
schedule:
25+
- cron: '34 7 * * 1'
26+
27+
jobs:
28+
analyze:
29+
name: Analyze
30+
runs-on: ubuntu-latest
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'go' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37+
# Learn more:
38+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v3
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v2
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v2
58+
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
61+
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
65+
66+
#- run: |
67+
# make bootstrap
68+
# make release
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v2

.github/workflows/go_test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
branches:
7+
- main
8+
9+
name: golangci-lint
10+
jobs:
11+
golangci:
12+
strategy:
13+
matrix:
14+
go-version:
15+
- "1.20"
16+
- "1.21"
17+
name: lint and test
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
- name: Install Go
23+
uses: actions/setup-go@v4
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
- name: golangci-lint
27+
uses: golangci/[email protected]
28+
with:
29+
version: v1.55.2
30+
- name: test
31+
run: make test

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
local_testing
11+
coverage.out
12+
13+
# Output of the go coverage tool, specifically when used with LiteIDE
14+
*.out
15+
16+
# Dependency directories (remove the comment below to include it)
17+
vendor/
18+
19+
# IDE project files
20+
.idea

.golangci.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
run:
2+
timeout: 5m
3+
issues-exit-code: 1
4+
tests: true
5+
skip-dirs:
6+
- local
7+
8+
issues:
9+
max-same-issues: 100
10+
exclude-rules:
11+
- path: _test\.go
12+
linters:
13+
- bodyclose
14+
- errcheck
15+
- gosec
16+
17+
linters:
18+
enable:
19+
- bodyclose
20+
- exportloopref
21+
- gofumpt
22+
- goimports
23+
- gosec
24+
- gosimple
25+
- govet
26+
- ineffassign
27+
- misspell
28+
- revive
29+
- staticcheck
30+
- typecheck
31+
- unused
32+
- whitespace
33+
34+
output:
35+
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
36+
format: colored-line-number
37+
# print lines of code with issue, default is true
38+
print-issued-lines: true
39+
# print linter name in the end of issue text, default is true
40+
print-linter-name: true
41+
# make issues output unique by line, default is true
42+
uniq-by-line: true
43+
# add a prefix to the output file references; default is no prefix
44+
path-prefix: ""
45+
# sorts results by: filepath, line and column
46+
sort-results: true
47+
48+
linters-settings:
49+
golint:
50+
min-confidence: 0.8
51+
52+
fix: true

CODE_OF_CONDUCT.md

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

CONTRIBUTING.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Contributing to gocron
2+
3+
Thank you for coming to contribute to gocron! We welcome new ideas, PRs and general feedback.
4+
5+
## Reporting Bugs
6+
7+
If you find a bug then please let the project know by opening an issue after doing the following:
8+
9+
- Do a quick search of the existing issues to make sure the bug isn't already reported
10+
- Try and make a minimal list of steps that can reliably reproduce the bug you are experiencing
11+
- Collect as much information as you can to help identify what the issue is (project version, configuration files, etc)
12+
13+
## Suggesting Enhancements
14+
15+
If you have a use case that you don't see a way to support yet, we would welcome the feedback in an issue. Before opening the issue, please consider:
16+
17+
- Is this a common use case?
18+
- Is it simple to understand?
19+
20+
You can help us out by doing the following before raising a new issue:
21+
22+
- Check that the feature hasn't been requested already by searching existing issues
23+
- Try and reduce your enhancement into a single, concise and deliverable request, rather than a general idea
24+
- Explain your own use cases as the basis of the request
25+
26+
## Adding Features
27+
28+
Pull requests are always welcome. However, before going through the trouble of implementing a change it's worth creating a bug or feature request issue.
29+
This allows us to discuss the changes and make sure they are a good fit for the project.
30+
31+
Please always make sure a pull request has been:
32+
33+
- Unit tested with `make test`
34+
- Linted with `make lint`
35+
36+
## Writing Tests
37+
38+
Tests should follow the [table driven test pattern](https://dave.cheney.net/2013/06/09/writing-table-driven-tests-in-go). See other tests in the code base for additional examples.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Go Co Op
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.PHONY: fmt lint test mocks test_coverage
2+
3+
GO_PKGS := $(shell go list -f {{.Dir}} ./...)
4+
5+
fmt:
6+
@go list -f {{.Dir}} ./... | xargs -I{} gofmt -w -s {}
7+
8+
lint:
9+
@golangci-lint run
10+
11+
test:
12+
@go test -race -v $(GO_FLAGS) -count=1 $(GO_PKGS)
13+
14+
test_coverage:
15+
@go test -race -v $(GO_FLAGS) -count=1 -coverprofile=coverage.out -covermode=atomic $(GO_PKGS)
16+
@go tool cover -html coverage.out
17+
18+
mocks:
19+
@go generate ./...

0 commit comments

Comments
 (0)