Skip to content

Commit

Permalink
style: add nice to have to the repository
Browse files Browse the repository at this point in the history
  • Loading branch information
JGiola committed Oct 17, 2024
1 parent 0bd2fd0 commit 92563ab
Show file tree
Hide file tree
Showing 41 changed files with 1,322 additions and 327 deletions.
46 changes: 46 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "Go",
"image": "golang:1.23.2",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {"username": "golang"},
"ghcr.io/devcontainers/features/go:1": {"version": "none", "golangciLintVersion": "1.61.0"},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true,
"installDockerComposeSwitch": false
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"customizations": {
"vscode": {
"settings": {
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": false,
"go.coverMode": "atomic",
"go.toolsManagement.checkForUpdates": "local",
"go.lintTool": "golangci-lint",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.buildFlags": [
"-tags=conformance,integration"
]
},
"extensions": [
"redhat.vscode-yaml",
"editorconfig.editorconfig",
"davidanson.vscode-markdownlint"
]
},
"codespaces": {
"openFiles": [
"README.md",
"CONTRIBUTING.md"
]
}
}
}
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.devcontainer
.git
.github
.idea
.vscode
config
tools
.dockerignore
.editorconfig
.gitignore
.go-version
.golangci.yaml
.goreleaser.yaml
.markdownlint.yaml
.pre-commit-config.yaml
**.md
Dockerfile
go.*
*.go
Makefile
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
indent_style = tab
indent_size = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120

[*.md]
trim_trailing_whitespace = false

[*.{yaml,yml}]
indent_style = space
tab_width = 2
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Actions must also be checked by security
.github/workflows @mia-platform/sig-security
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bug Report
description: Report a bug that you have experienced
title: "[Bug]: "
labels:
- bug
- needs triage
body:
- type: markdown
attributes:
value: "## Thank you for contributing to our project!"
- type: markdown
attributes:
value: Thanks for taking the time to fill out this bug report.
- id: version
type: input
attributes:
label: What version or versions you have tested?
description: Add one or more version where the bug is present
placeholder: ex. 1.0.0 or 1.0.0,1.0.1
- id: operating-systems
type: checkboxes
attributes:
label: Which operating systems have you used?
description: You may select more than one.
options:
- label: macOS
- label: Windows
- label: Linux
- id: expectation
type: textarea
attributes:
label: What did you expect to happen?
description: |
Describe what did you expect to happen if this bug wasn’t there.
validations:
required: true
- id: problem
type: textarea
attributes:
label: What happened instead?
description: |
Please describe what happened and provide every detail you can for reproducing it.
validations:
required: true
- id: code-of-conduct
type: checkboxes
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](./CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project’s Code of Conduct
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Mia-Platform Community Support
url: https://github.com/mia-platform/community/discussions
about: Please ask and answer questions here.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Documenation
description: Request a missing documentation or the correction of a wrong one
title: "[Docs]: "
labels:
- documentation
- needs triage
body:
- type: markdown
attributes:
value: "## Thank you for contributing to our project!"
- type: markdown
attributes:
value: Thanks for taking the time to fill out this documenation request.
- id: documentation
type: textarea
attributes:
label: Documentation Revision
description: |
Please describe what you want to be documented or the docs that must be corrected and why.
validations:
required: true
- id: code-of-conduct
type: checkboxes
attributes:
label: Code of Conduct
description: By submitting this documentation revision, you agree to follow our [Code of Conduct](./CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project’s Code of Conduct
required: true
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/new-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: New Feature
description: Describe a new feature that you want implemented
title: "[Feature]: "
labels:
- enhancement
- needs triage
body:
- type: markdown
attributes:
value: "## Thank you for contributing to our project!"
- type: markdown
attributes:
value: Thanks for taking the time to fill out this feature request.
- id: new-feature
type: textarea
attributes:
label: Describe the feature
description: |
Please describe what you want to be implemented and why.
validations:
required: true
- id: code-of-conduct
type: checkboxes
attributes:
label: Code of Conduct
description: By submitting this feature, you agree to follow our [Code of Conduct](./CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project’s Code of Conduct
required: true
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Hi, and thank you for your time dedicated to this pull request! Please provide a description
of the work you have done and be sure to link to the relative open issue if is present.
Be aware that all the work you have done should include also the relative tests to assure the
correct behavior and avoid possible regressions in the future.
-->

## What this PR is for?

<!--
Describe what this PR is trying to achieve, for example is this a PR that fix an open issue? Is for a new feature? etc.
-->

**Which issue(s) this PR fixes:**
<!--
Link any associated issues with this PR for automatically close them when the PR is merged. You can reference them
with only `#<issue number>` or via the full link to the issue.
-->
- Fixes #
51 changes: 51 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: 2

updates:
# keep up to date the github actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
timezone: Europe/Rome
groups:
minor-actions-dependencies:
update-types:
- minor
- patch
commit-message:
include: scope
prefix: ci

# keep up to date the base docker image
- package-ecosystem: docker
directory: /
schedule:
interval: daily
time: "07:00"
timezone: Europe/Rome
commit-message:
include: scope
prefix: build

# enable go dependencies security updates
- directory: /
open-pull-requests-limit: 0
package-ecosystem: gomod
rebase-strategy: auto
schedule:
interval: daily
time: "07:00"
timezone: Europe/Rome
commit-message:
include: scope
prefix: chore

# keep up to date devcontainers
- package-ecosystem: devcontainers
directory: "/"
schedule:
interval: monthly
timezone: Europe/Rome
commit-message:
include: scope
prefix: build
45 changes: 45 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Code Scanning
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
paths-ignore:
- "**/*.md"
- docs/**
- examples/**
schedule:
- cron: 0 5 * * 1 # Run every monday at 5 UTC

env:
GORELEASER_VERSION: v2.3.2

jobs:
codeql:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: false
- name: Setup Golang
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
- name: Setup Goreleaser
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
version: ${{ env.GORELEASER_VERSION }}
install-only: true
- name: Initialize CodeQL
uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
with:
languages: go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
27 changes: 27 additions & 0 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Dependency Review
on:
pull_request:
branches:
- main
paths-ignore:
- "**/*.md"
- docs/**
- examples/**

jobs:
dependency-review:
name: Dependencies Review
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: false
- name: Dependency Review
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
with:
fail-on-scope: runtime,development,unknown
comment-summary-in-pr: on-failure
Loading

0 comments on commit 92563ab

Please sign in to comment.