From db25729e045b1f9bde7122599a8a0b8c8d53a167 Mon Sep 17 00:00:00 2001 From: Xorima Bot Date: Thu, 7 Jan 2021 13:01:17 +0000 Subject: [PATCH] Standardise files with files in sous-chefs/repo-management Signed-off-by: Xorima Bot --- .circleci/config.yml | 10 ++++++++ .envrc | 1 + .github/workflows/md-links.yml | 19 ++++++++++++++ .github/workflows/stale.yml | 28 ++++++++++++++++++++ .gitignore | 5 ++-- .overcommit.yml | 20 +++++++++++++++ .vscode/extensions.json | 2 +- .yamllint | 7 +++++ CODE_OF_CONDUCT.md | 4 ++- CONTRIBUTING.md | 4 ++- Dangerfile | 47 ++++++++++++++++++++++++++++++++++ TESTING.md | 5 ++-- documentation/.gitkeep | 0 13 files changed, 144 insertions(+), 8 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 .envrc create mode 100644 .github/workflows/md-links.yml create mode 100644 .github/workflows/stale.yml create mode 100644 .overcommit.yml create mode 100644 .yamllint create mode 100644 Dangerfile create mode 100644 documentation/.gitkeep diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8af810e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,10 @@ +--- +version: 2.1 +orbs: + kitchen: sous-chefs/kitchen@2 +workflows: + danger: + jobs: + - kitchen/danger: + name: danger + context: Danger-Minimal diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..6ed589e --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use chefworkstation diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml new file mode 100644 index 0000000..150e75c --- /dev/null +++ b/.github/workflows/md-links.yml @@ -0,0 +1,19 @@ +--- +name: md-links + +"on": + pull_request: + push: + branches: [master] + +jobs: + md-links: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@master + - name: markdown-link-check + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-verbose-mode: "yes" + folder-path: "documentation" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..0f33701 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,28 @@ +--- +name: Mark stale issues and pull requests + +"on": + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + close-issue-message: > + Closing due to inactivity. + If this is still an issue please reopen or open another issue. + Alternatively drop by the #sous-chefs channel on the [Chef Community Slack](http://community-slack.chef.io/) and we'll be happy to help! + Thanks, Sous-Chefs. + days-before-close: 7 + days-before-stale: 365 + stale-issue-message: > + Marking stale due to inactivity. + Remove stale label or comment or this will be closed in 7 days. + Alternatively drop by the #sous-chefs channel on the [Chef Community Slack](http://community-slack.chef.io/) and we'll be happy to help! + Thanks, Sous-Chefs. diff --git a/.gitignore b/.gitignore index e6099d3..be3b9a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.rbc .config InstalledFiles -lib/bundler/man pkg test/tmp test/version_tmp @@ -16,11 +15,11 @@ _Store *.bk *.bkup -# editor temp files +# editor files .idea .*.sw[a-z] -# ruby/bundler files +# ruby/bundler/rspec files .ruby-version .ruby-gemset .rvmrc diff --git a/.overcommit.yml b/.overcommit.yml new file mode 100644 index 0000000..1d27ed8 --- /dev/null +++ b/.overcommit.yml @@ -0,0 +1,20 @@ +--- +PreCommit: + TrailingWhitespace: + enabled: true + YamlLint: + enabled: true + Rspec: + enabled: true + required_executable: 'rspec' + Cookstyle: + enabled: true + required_executable: 'cookstyle' + command: ["cookstyle"] + Delivery: + enabled: true + required_executable: 'delivery' + flags: ['local', 'all'] +CommitMsg: + HardTabs: + enabled: true diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 064bba0..cd77725 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,4 +4,4 @@ "rebornix.ruby", "editorconfig.editorconfig" ] -} \ No newline at end of file +} diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..2d69612 --- /dev/null +++ b/.yamllint @@ -0,0 +1,7 @@ +--- +extends: default +rules: + line-length: + max: 256 + level: warning + document-start: disable diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index aa60a51..20b4adb 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1,3 @@ -Please refer to the Chef Community Code of Conduct at +# Community Guidelines + +This project follows the Chef Community Guidelines diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef2f2b8..a946aea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,2 +1,4 @@ +# Contributing + Please refer to -https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD +[https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 0000000..bc08b7a --- /dev/null +++ b/Dangerfile @@ -0,0 +1,47 @@ +# Reference: http://danger.systems/reference.html + +# A pull request summary is required. Add a description of the pull request purpose. +# Changelog must be updated for each pull request that changes code. +# Warnings will be issued for: +# Pull request with more than 400 lines of code changed +# Pull reqest that change more than 5 lines without test changes +# Failures will be issued for: +# Pull request without summary +# Pull requests with code changes without changelog entry + +def code_changes? + code = %w(libraries attributes recipes resources files templates) + code.each do |location| + return true unless git.modified_files.grep(/#{location}/).empty? + end + false +end + +def test_changes? + tests = %w(spec test kitchen.yml kitchen.dokken.yml) + tests.each do |location| + return true unless git.modified_files.grep(/#{location}/).empty? + end + false +end + +failure 'Please provide a summary of your Pull Request.' if github.pr_body.length < 10 + +warn 'This is a big Pull Request.' if git.lines_of_code > 400 + +warn 'This is a Table Flip.' if git.lines_of_code > 2000 + +# Require a CHANGELOG entry for non-test changes. +if !git.modified_files.include?('CHANGELOG.md') && code_changes? + failure 'Please include a CHANGELOG entry.' +end + +# Require Major Minor Patch version labels +unless github.pr_labels.grep /minor|major|patch/i + warn 'Please add a release label to this pull request' +end + +# A sanity check for tests. +if git.lines_of_code > 5 && code_changes? && !test_changes? + warn 'This Pull Request is probably missing tests.' +end diff --git a/TESTING.md b/TESTING.md index 9596d9b..920e381 100644 --- a/TESTING.md +++ b/TESTING.md @@ -1,2 +1,3 @@ -Please refer to - +# Testing + +Please refer to [the community cookbook documentation on testing](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD). diff --git a/documentation/.gitkeep b/documentation/.gitkeep new file mode 100644 index 0000000..e69de29