-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from fahedouch/repo-improvement
repo imporve
- Loading branch information
Showing
12 changed files
with
383 additions
and
97 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,22 @@ | ||
# ----------------------------------------------------------------------------- | ||
# Forked from https://raw.githubusercontent.com/opencontainers/runc/2888e6e54339e52ae45710daa9e47cdb2e1926f9/.github/dependabot.yml | ||
# Copyright The runc Authors. | ||
# Licensed under the Apache License, Version 2.0 | ||
# ----------------------------------------------------------------------------- | ||
|
||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
# Dependencies listed in go.mod | ||
- package-ecosystem: "gomod" | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
|
||
# Dependencies listed in .github/workflows/*.yml | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,38 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'release/**' | ||
pull_request: | ||
|
||
jobs: | ||
golangci-lint: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18.x | ||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: v1.45.0 | ||
args: --verbose | ||
|
||
test-unit: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18.x | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 1 | ||
- name: "Run unit tests" | ||
run: go test -v . |
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,23 @@ | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe | ||
*.test |
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,138 @@ | ||
--- | ||
run: | ||
concurrency: 6 | ||
deadline: 5m | ||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- depguard | ||
- gofmt | ||
- goimports | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- prealloc | ||
- structcheck | ||
- typecheck | ||
- varcheck | ||
# - asciicheck | ||
# - bodyclose | ||
# - dogsled | ||
# - dupl | ||
# - errcheck | ||
# - errorlint | ||
# - exhaustive | ||
# - exhaustivestruct | ||
# - exportloopref | ||
# - funlen | ||
# - gci | ||
# - gochecknoglobals | ||
# - gochecknoinits | ||
# - gocognit | ||
# - goconst | ||
# - gocritic | ||
# - gocyclo | ||
# - godot | ||
# - godox | ||
# - goerr113 | ||
# - gofumpt | ||
# - goheader | ||
# - golint | ||
# - gomnd | ||
# - gomodguard | ||
# - goprintffuncname | ||
# - gosec (gas) | ||
- gosimple # (megacheck) | ||
# - interfacer | ||
# - lll | ||
# - maligned | ||
# - nestif | ||
# - nlreturn | ||
# - noctx | ||
# - nolintlint | ||
# - rowserrcheck | ||
# - scopelint | ||
# - sqlclosecheck | ||
- staticcheck | ||
- stylecheck | ||
# - testpackage | ||
# - tparallel | ||
# - unconvert | ||
# - unparam | ||
# - unused | ||
# - whitespace | ||
# - wrapcheck | ||
# - wsl | ||
linters-settings: | ||
gocritic: | ||
enabled-checks: | ||
# Diagnostic | ||
- appendAssign | ||
- argOrder | ||
- badCond | ||
- caseOrder | ||
- codegenComment | ||
- commentedOutCode | ||
- deprecatedComment | ||
- dupArg | ||
- dupBranchBody | ||
- dupCase | ||
- dupSubExpr | ||
- exitAfterDefer | ||
- flagDeref | ||
- flagName | ||
- nilValReturn | ||
- offBy1 | ||
- sloppyReassign | ||
- weakCond | ||
- octalLiteral | ||
|
||
# Performance | ||
- appendCombine | ||
- equalFold | ||
- hugeParam | ||
- indexAlloc | ||
- rangeExprCopy | ||
- rangeValCopy | ||
|
||
# Style | ||
- assignOp | ||
- boolExprSimplify | ||
- captLocal | ||
- commentFormatting | ||
- commentedOutImport | ||
- defaultCaseOrder | ||
- docStub | ||
- elseif | ||
- emptyFallthrough | ||
- emptyStringTest | ||
- hexLiteral | ||
- ifElseChain | ||
- methodExprCall | ||
- regexpMust | ||
- singleCaseSwitch | ||
- sloppyLen | ||
- stringXbytes | ||
- switchTrue | ||
- typeAssertChain | ||
- typeSwitchVar | ||
- underef | ||
- unlabelStmt | ||
- unlambda | ||
- unslice | ||
- valSwap | ||
- wrapperFunc | ||
- yodaStyleExpr | ||
|
||
# Opinionated | ||
- builtinShadow | ||
- importShadow | ||
- initClause | ||
- nestingReduce | ||
- paramTypeCombine | ||
- ptrToRefParam | ||
- typeUnparen | ||
- unnamedResult | ||
- unnecessaryBlock |
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,26 @@ | ||
//go:build linux | ||
// +build linux | ||
|
||
package logrotate | ||
|
||
import ( | ||
"log" | ||
"os" | ||
"os/signal" | ||
"syscall" | ||
) | ||
|
||
// Example of how to rotate in response to SIGHUP. | ||
func ExampleLogger_Rotate() { | ||
l := &Logger{} | ||
log.SetOutput(l) | ||
c := make(chan os.Signal, 1) | ||
signal.Notify(c, syscall.SIGHUP) | ||
|
||
go func() { | ||
for { | ||
<-c | ||
l.Rotate() | ||
} | ||
}() | ||
} |
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,4 +1,4 @@ | ||
module github.com/fahedouch/log-rotate | ||
module github.com/fahedouch/go-logrotate | ||
|
||
go 1.18 | ||
|
||
|
Oops, something went wrong.