Skip to content

Commit

Permalink
Added contributing.md and re-organized packages to prepare for future…
Browse files Browse the repository at this point in the history
… re-factoring (#34)

* Added contributing.md and re-organized packages to prepare for future re-factoring

* Fixed unintentional hunter and rules renames

* Fixed additional occurences of accidental rename

Co-authored-by: Britton Hayes <[email protected]>
  • Loading branch information
brittonhayes and brittonhayes authored Apr 9, 2021
1 parent 319da4a commit efae84b
Show file tree
Hide file tree
Showing 27 changed files with 127 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
21 changes: 0 additions & 21 deletions .github/workflows/benchmark.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ builds:
- windows
- darwin
ldflags:
- -s -w -X github.com/brittonhayes/pillager/cmd.version={{.Version}}
- -s -w -X github.com/brittonhayes/pillager/cmd/pillager.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -X main.builtBy=goreleaser
Expand Down
94 changes: 94 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure you've implemented a test for any new features and that this test passes with `go test -v ./...`. Go test will
be run against your PR anyways, so it saves you time to make sure it passes. Additionally, please run golangci-lint
to ensure you're following our stylistic standards.
2. Update the GoDoc comments with any changes to interfaces, methods, types or similar. Try to keep the effective Go
guidelines in mind at all times.
3. If you implement any breaking features, please make that clear in your commits or PRs. This allows
us to effectively document this for end users.
The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in once you have the sign-off of one other developer, or if you
do not have permission to do that, you may request the reviewer to merge it for you.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team via our available contact information or upon request. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Offender: {{ .Offender }}
## Documentation

:books: [View the docs](hunter)
:books: [View the docs](pkg/hunter)

GoDoc documentation is available on [pkg.go.dev for pillager](https://pkg.go.dev/github.com/brittonhayes/pillager) but
it is also available for all packages in the repository in markdown format. Just open the folder of any package, and
Expand Down
8 changes: 5 additions & 3 deletions _examples/hunter/main.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package main

import (
"github.com/brittonhayes/pillager/hunter"
"github.com/brittonhayes/pillager/rules"
"runtime"

"github.com/brittonhayes/pillager/pkg/hunter"
"github.com/brittonhayes/pillager/pkg/rules"
"github.com/spf13/afero"
)

func main() {
// Create a new hunter config
c := hunter.NewConfig(afero.NewOsFs(), ".", true, rules.Load(""), hunter.StringToFormat("JSON"))
c := hunter.NewConfig(afero.NewOsFs(), ".", true, rules.Load(""), hunter.StringToFormat("JSON"), "", runtime.NumCPU())

// Create a new hunter from the config
h := hunter.NewHunter(c)
Expand Down
56 changes: 0 additions & 56 deletions benchmarks_test.go

This file was deleted.

File renamed without changes.
10 changes: 5 additions & 5 deletions cmd/hunt.go → cmd/pillager/hunt.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Package cmd contains the command line logic
// Package pillager contains the command line logic
//
// The cmd package is the primary consumer of all packages in the /pkg directory
package cmd
// The pillager package is the primary consumer of all packages in the /pkg directory
package pillager

import (
"runtime"

"github.com/brittonhayes/pillager/hunter"
"github.com/brittonhayes/pillager/rules"
"github.com/brittonhayes/pillager/pkg/hunter"
"github.com/brittonhayes/pillager/pkg/rules"
"github.com/spf13/afero"
"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go → cmd/pillager/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pillager

import (
"fmt"
Expand Down Expand Up @@ -32,7 +32,7 @@ var rootCmd = &cobra.Command{
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
// This is called by pillager.pillager(). It only needs to happen once to the rootCmd.
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go → cmd/pillager/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pillager

import (
"fmt"
Expand Down
5 changes: 5 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ THE SOFTWARE.
// scoop bucket add pillager https://github.com/brittonhayes/pillager-scoop.git
// scoop install pillager
//
// OSX/Linux
//
// brew tap brittonhayes/homebrew-pillager
// brew install pillager
//
package main
9 changes: 5 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package main

import (
"github.com/brittonhayes/pillager/cmd/pillager"
)

//go:generate golangci-lint run ./...
//go:generate golines ./ -w -m 150
//go:generate gomarkdoc ./hunter/...
//go:generate gomarkdoc ./rules/...

import "github.com/brittonhayes/pillager/cmd"

func main() {
cmd.Execute()
pillager.Execute()
}
File renamed without changes.
2 changes: 1 addition & 1 deletion hunter/config.go → pkg/hunter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/brittonhayes/pillager/internal/validate"
"github.com/brittonhayes/pillager/rules"
"github.com/brittonhayes/pillager/pkg/rules"
"github.com/spf13/afero"
gitleaks "github.com/zricethezav/gitleaks/v7/config"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion hunter/hound_test.go → pkg/hunter/hound_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hunter

import (
"github.com/brittonhayes/pillager/rules"
"github.com/brittonhayes/pillager/pkg/rules"
"github.com/spf13/afero"
"github.com/zricethezav/gitleaks/v7/scan"
)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion hunter/hunter_test.go → pkg/hunter/hunter_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hunter

import (
"github.com/brittonhayes/pillager/rules"
"github.com/brittonhayes/pillager/pkg/rules"
"github.com/spf13/afero"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion templates/templates.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package templates

import _ "embed"
import (
_ "embed"
)

var (
//go:embed simple.tmpl
Expand Down
2 changes: 1 addition & 1 deletion waypoint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ app "cli" {

build {
use "docker" {
dockerfile = "Dockerfile"
dockerfile = "build/Dockerfile"
}

registry {
Expand Down

0 comments on commit efae84b

Please sign in to comment.