way_of_working-changelog-keepachangelog 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 76adcd5458f1dc834c84f60a7a373f7e4c8d3ef278fb0e52aeba5608d92ce10a
4
+ data.tar.gz: d8f0a5ebb3bbe32adcb8004fce8194d60f255a739ef53909e3ee5b4fd6733acd
5
+ SHA512:
6
+ metadata.gz: b8a4dde18d8fadfa90abe34b999d32ceda2be94ddae5f6afd97e320a800f8b276236b9d2351d0d210e67223cddeee9fdb568b9af08151b76c028612b20d57e41
7
+ data.tar.gz: e3901b676eadd19ae5d8232faeebbd76f0fc1d764a9f44a276d116c7410f9274b06e147682e3774fc8fc9ee564d6decd7f1bec722d24a8c382bed21ce95c7adc
data/.alexrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "profanitySureness": 1
3
+ }
data/.mega-linter.yml ADDED
@@ -0,0 +1,145 @@
1
+ ---
2
+ # Configuration file for MegaLinter
3
+ # See all available variables at https://megalinter.io/configuration/
4
+ # and in linters documentation
5
+
6
+ APPLY_FIXES: none # all, none, or list of linter keys
7
+ ENABLE_LINTERS: # All other linters will be disabled by default
8
+ ### Languages
9
+ - BASH_EXEC # in Super-Linter
10
+ - BASH_SHELLCHECK # in Super-Linter
11
+ - BASH_SHFMT # in Super-Linter
12
+ - C_CLANG_FORMAT
13
+ - C_CPPLINT
14
+ # - CLOJURE_CLJ_KONDO # in Super-Linter
15
+ # - CLOJURE_CLJSTYLE
16
+ - COFFEE_COFFEELINT # in Super-Linter
17
+ - CPP_CLANG_FORMAT
18
+ - CPP_CPPLINT # in Super-Linter
19
+ - CSHARP_CSHARPIER
20
+ - CSHARP_DOTNET_FORMAT # in Super-Linter
21
+ - CSHARP_ROSLYNATOR
22
+ - DART_DARTANALYZER # in Super-Linter
23
+ - GO_GOLANGCI_LINT # in Super-Linter
24
+ - GO_REVIVE
25
+ # - GROOVY_NPM_GROOVY_LINT # in Super-Linter
26
+ - JAVA_CHECKSTYLE # in Super-Linter
27
+ - JAVA_PMD
28
+ - JAVASCRIPT_ES # in Super-Linter
29
+ # - JAVASCRIPT_PRETTIER
30
+ - JAVASCRIPT_STANDARD # in Super-Linter
31
+ - JSX_ESLINT
32
+ - KOTLIN_DETEKT
33
+ - KOTLIN_KTLINT # in Super-Linter
34
+ # - LUA_LUACHECK # in Super-Linter
35
+ # - LUA_SELENE
36
+ # - LUA_STYLUA
37
+ - MAKEFILE_CHECKMAKE
38
+ # - PERL_PERLCRITIC # in Super-Linter
39
+ # - PHP_BUILTIN
40
+ # - PHP_PHPCS # in Super-Linter
41
+ # - PHP_PHPCSFIXER
42
+ # - PHP_PHPLINT # in Super-Linter
43
+ # - PHP_PHPSTAN # in Super-Linter
44
+ # - PHP_PSALM # in Super-Linter
45
+ # - POWERSHELL_POWERSHELL
46
+ # - POWERSHELL_POWERSHELL_FORMATTER
47
+ - PYTHON_BANDIT
48
+ - PYTHON_BLACK # in Super-Linter
49
+ - PYTHON_FLAKE8 # in Super-Linter
50
+ - PYTHON_ISORT # in Super-Linter
51
+ - PYTHON_MYPY
52
+ - PYTHON_PYLINT # in Super-Linter
53
+ - PYTHON_PYRIGHT
54
+ - PYTHON_RUFF
55
+ - R_LINTR # in Super-Linter
56
+ # - RAKU_RAKU # in Super-Linter
57
+ # - RUBY_RUBOCOP # in Super-Linter
58
+ - RUST_CLIPPY # in Super-Linter
59
+ # - SALESFORCE_LIGHTNING_FLOW_SCANNER
60
+ # - SALESFORCE_SFDX_SCANNER_APEX
61
+ # - SALESFORCE_SFDX_SCANNER_AURA
62
+ # - SALESFORCE_SFDX_SCANNER_LWC
63
+ - SCALA_SCALAFIX
64
+ - SQL_SQLFLUFF # in Super-Linter
65
+ - SQL_TSQLLINT
66
+ - SWIFT_SWIFTLINT
67
+ - TSX_ESLINT
68
+ - TYPESCRIPT_ES # in Super-Linter
69
+ # - TYPESCRIPT_PRETTIER
70
+ - TYPESCRIPT_STANDARD # in Super-Linter
71
+ # - VBDOTNET_DOTNET_FORMAT
72
+
73
+ ### Formats
74
+ - CSS_STYLELINT # in Super-Linter
75
+ - ENV_DOTENV_LINTER # in Super-Linter
76
+ # - GRAPHQL_GRAPHQL_SCHEMA_LINTER
77
+ # - HTML_DJLINT # Refuses to see config file
78
+ - HTML_HTMLHINT # in Super-Linter
79
+ - JSON_ESLINT_PLUGIN_JSONC # in Super-Linter
80
+ - JSON_JSONLINT
81
+ - JSON_NPM_PACKAGE_JSON_LINT
82
+ # - JSON_PRETTIER
83
+ - JSON_V8R
84
+ # - LATEX_CHKTEX # in Super-Linter
85
+ - MARKDOWN_MARKDOWNLINT # in Super-Linter
86
+ - MARKDOWN_MARKDOWN_LINK_CHECK
87
+ - MARKDOWN_MARKDOWN_TABLE_FORMATTER
88
+ - MARKDOWN_REMARK_LINT
89
+ # - PROTOBUF_PROTOLINT # in Super-Linter
90
+ # - RST_RSTCHECK
91
+ # - RST_RSTFMT
92
+ # - RST_RST_LINT
93
+ - XML_XMLLINT # in Super-Linter
94
+ # - YAML_PRETTIER
95
+ - YAML_V8R
96
+ - YAML_YAMLLINT # in Super-Linter
97
+
98
+ ### Tooling
99
+ - ACTION_ACTIONLINT # in Super-Linter
100
+ - ANSIBLE_ANSIBLE_LINT # in Super-Linter
101
+ - API_SPECTRAL
102
+ - ARM_ARM_TTK # in Super-Linter
103
+ # - BICEP_BICEP_LINTER
104
+ - CLOUDFORMATION_CFN_LINT # in Super-Linter
105
+ - DOCKERFILE_HADOLINT # in Super-Linter
106
+ - EDITORCONFIG_EDITORCONFIG_CHECKER # in Super-Linter
107
+ # - GHERKIN_GHERKIN_LINT # in Super-Linter
108
+ - KUBERNETES_HELM
109
+ - KUBERNETES_KUBECONFORM
110
+ - KUBERNETES_KUBESCAPE
111
+ - PUPPET_PUPPET_LINT
112
+ # - SNAKEMAKE_LINT # in Super-Linter
113
+ # - SNAKEMAKE_SNAKEFMT # in Super-Linter
114
+ # - TEKTON_TEKTON_LINT # in Super-Linter
115
+ - TERRAFORM_TERRAFORM_FMT # in Super-Linter
116
+ - TERRAFORM_TERRAGRUNT # in Super-Linter
117
+ - TERRAFORM_TERRASCAN # in Super-Linter
118
+ - TERRAFORM_TFLINT # in Super-Linter
119
+
120
+ ### Code quality checkers
121
+ - COPYPASTE_JSCPD # in Super-Linter
122
+ - REPOSITORY_CHECKOV
123
+ - REPOSITORY_DEVSKIM
124
+ - REPOSITORY_DUSTILOCK
125
+ - REPOSITORY_GIT_DIFF
126
+ - REPOSITORY_GITLEAKS # in Super-Linter
127
+ - REPOSITORY_GRYPE
128
+ - REPOSITORY_KICS
129
+ - REPOSITORY_LS_LINT
130
+ - REPOSITORY_SECRETLINT
131
+ - REPOSITORY_SEMGREP
132
+ - REPOSITORY_SYFT
133
+ - REPOSITORY_TRIVY
134
+ - REPOSITORY_TRIVY_SBOM
135
+ - REPOSITORY_TRUFFLEHOG
136
+ # - SPELL_CSPELL
137
+ - SPELL_LYCHEE
138
+ - SPELL_PROSELINT
139
+ - SPELL_VALE
140
+
141
+ SHOW_ELAPSED_TIME: false
142
+ FILEIO_REPORTER: false
143
+ FAIL_IF_MISSING_LINTER_IN_FLAVOR: true
144
+ # DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect
145
+ # errors but not block CI to pass
data/.rubocop ADDED
@@ -0,0 +1 @@
1
+ --config .github/linters/rubocop_defaults.yml
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.0.0] - 2025-10-24
11
+
12
+ ### Added
13
+
14
+ - Initial release of init command and GitHub audit rule
15
+
16
+ [unreleased]: https://github.com/HealthDataInsight/way_of_working-changelog-keepachangelog/compare/v1.0.0...HEAD
17
+ [1.0.0]: https://github.com/HealthDataInsight/way_of_working-changelog-keepachangelog/releases/tag/v1.0.0
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Health Data Insight CIC
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # WayOfWorking::Changelog::Keepachangelog
2
+
3
+ <!-- Way of Working: Main Badge Holder Start -->
4
+ ![Way of Working Badge](https://img.shields.io/badge/Way_of_Working-v2.0.1-%238169e3?labelColor=black)
5
+ <!-- Way of Working: Additional Badge Holder Start -->
6
+ <!-- Way of Working: Badge Holder End -->
7
+
8
+ This is a plugin for the [Way of Working](https://github.com/HealthDataInsight/way_of_working) framework. It uses [keep a changelog](https://keepachangelog.com/en/1.1.0/) version 1.1.0. It has a well-defined structure that makes it an accessible format for people and tooling.
9
+
10
+ To quote from their website:
11
+
12
+ > Guiding Principles:
13
+ > * Changelogs are for humans, not machines.
14
+ > * There should be an entry for every single version.
15
+ > * The same types of changes should be grouped.
16
+ > * Versions and sections should be linkable.
17
+ > * The latest version comes first.
18
+ > * The release date of each version is displayed.
19
+ > * Mention whether you follow Semantic Versioning.
20
+
21
+ Grouping changes into a clear set of change types:
22
+
23
+ > * `Added` for new features.
24
+ > * `Changed` for changes in existing functionality.
25
+ > * `Deprecated` for soon-to-be removed features.
26
+ > * `Removed` for now removed features.
27
+ > * `Fixed` for any bug fixes.
28
+ > * `Security` in case of vulnerabilities.
29
+
30
+ Unlike automatic tools like github-changelog-generator, keep a changelog is a human-written, plain English summary of changes. It is **not** a commit log dump; please do not use it as such.
31
+
32
+ We recommend that you and your team update the changelog within your Pull Requests, which avoids the need to add to the changelog much later, at release. Please read the [keep a changelog](https://keepachangelog.com/en/1.1.0/) website. It's a single page with lots of important advice about the benefits and dangers of an incomplete changelog, but as it says in the FAQs, you can always revisit and improve a changelog over time.
33
+
34
+ ## Installation
35
+
36
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
37
+
38
+ Install the gem and add to the application's Gemfile by executing:
39
+
40
+ ```bash
41
+ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
42
+ ```
43
+
44
+ If bundler is not being used to manage dependencies, install the gem by executing:
45
+
46
+ ```bash
47
+ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
48
+ ```
49
+
50
+ ## Usage
51
+
52
+ To add a [keep a changelog v1.1.0](https://keepachangelog.com/en/1.1.0/) changelog to your project, use the following at the command line:
53
+
54
+ ```bash
55
+ way_of_working init changelog
56
+ ```
57
+
58
+ The Way of Working command line tool scaffolds a new changelog on new and longstanding projects.
59
+
60
+ On longstanding git-based projects, it reads the release tags and scaffolds a changelog with the expected changes of a [semantically versioned](https://semver.org) project. So, for example, a patch or minor version change won't contain a scaffolded `Removed` section.
61
+
62
+ Please use the links within the scaffolded changelog to view all the commits between releases to document historical changes.
63
+
64
+ ## Development
65
+
66
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
67
+
68
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
69
+
70
+ ## Contributing
71
+
72
+ Bug reports and pull requests are welcome on GitHub at https://github.com/HealthDataInsight/way_of_working-changelog-keepachangelog. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/HealthDataInsight/way_of_working-changelog-keepachangelog/blob/main/CODE_OF_CONDUCT.md).
73
+
74
+ ## License
75
+
76
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
77
+
78
+ ## Code of Conduct
79
+
80
+ Everyone interacting in the WayOfWorking::Changelog::Keepachangelog project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/HealthDataInsight/way_of_working-changelog-keepachangelog/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rake/testtask'
5
+ require 'way_of_working/tasks'
6
+
7
+ Rake::TestTask.new(:test) do |t|
8
+ t.libs << 'lib'
9
+ t.libs << 'test'
10
+ t.test_files = FileList['test/**/*_test.rb']
11
+ t.verbose = false
12
+ t.warning = false
13
+ end
14
+
15
+ desc 'Run tests'
16
+ task default: :test
data/code_safety.yml ADDED
@@ -0,0 +1,130 @@
1
+ ---
2
+ file safety:
3
+ ".alexrc":
4
+ comments:
5
+ reviewed_by: timgentry
6
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
7
+ ".github/linters/.markdown-link-check.json":
8
+ comments:
9
+ reviewed_by: timgentry
10
+ safe_revision: c6967c0cb2b341ab33d5d134af666c0a4e6ade7d
11
+ ".github/linters/rubocop_defaults.yml":
12
+ comments:
13
+ reviewed_by: timgentry
14
+ safe_revision: c6967c0cb2b341ab33d5d134af666c0a4e6ade7d
15
+ ".github/workflows/inclusive-language.yml":
16
+ comments:
17
+ reviewed_by: timgentry
18
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
19
+ ".github/workflows/main.yml":
20
+ comments:
21
+ reviewed_by: timgentry
22
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
23
+ ".github/workflows/mega-linter.yml":
24
+ comments:
25
+ reviewed_by: timgentry
26
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
27
+ ".gitignore":
28
+ comments:
29
+ reviewed_by: timgentry
30
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
31
+ ".mega-linter.yml":
32
+ comments:
33
+ reviewed_by: timgentry
34
+ safe_revision: c6967c0cb2b341ab33d5d134af666c0a4e6ade7d
35
+ ".rubocop":
36
+ comments:
37
+ reviewed_by: timgentry
38
+ safe_revision: c6967c0cb2b341ab33d5d134af666c0a4e6ade7d
39
+ CHANGELOG.md:
40
+ comments:
41
+ reviewed_by: shilpigoeldev
42
+ safe_revision: 2664c0424e3eb7d51f7b64062ad92f796cc315e1
43
+ Gemfile:
44
+ comments:
45
+ reviewed_by: timgentry
46
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
47
+ Gemfile.lock:
48
+ comments:
49
+ reviewed_by: timgentry
50
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
51
+ LICENSE.txt:
52
+ comments:
53
+ reviewed_by: timgentry
54
+ safe_revision: c6967c0cb2b341ab33d5d134af666c0a4e6ade7d
55
+ README.md:
56
+ comments:
57
+ reviewed_by: timgentry
58
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
59
+ Rakefile:
60
+ comments:
61
+ reviewed_by: timgentry
62
+ safe_revision: c6967c0cb2b341ab33d5d134af666c0a4e6ade7d
63
+ bin/console:
64
+ comments:
65
+ reviewed_by: timgentry
66
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
67
+ bin/setup:
68
+ comments:
69
+ reviewed_by: timgentry
70
+ safe_revision: c6967c0cb2b341ab33d5d134af666c0a4e6ade7d
71
+ docs/way_of_working/changelog.md:
72
+ comments:
73
+ reviewed_by: timgentry
74
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
75
+ lib/way_of_working/changelog/keepachangelog.rb:
76
+ comments:
77
+ reviewed_by: shilpigoeldev
78
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
79
+ lib/way_of_working/changelog/keepachangelog/generators/init.rb:
80
+ comments:
81
+ reviewed_by: shilpigoeldev
82
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
83
+ lib/way_of_working/changelog/keepachangelog/github_audit_rule.rb:
84
+ comments:
85
+ reviewed_by: shilpigoeldev
86
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
87
+ lib/way_of_working/changelog/keepachangelog/paths.rb:
88
+ comments:
89
+ reviewed_by: shilpigoeldev
90
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
91
+ lib/way_of_working/changelog/keepachangelog/plugin.rb:
92
+ comments:
93
+ reviewed_by: timgentry
94
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
95
+ lib/way_of_working/changelog/keepachangelog/templates/docs/way_of_working/changelog.md:
96
+ comments:
97
+ reviewed_by: timgentry
98
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
99
+ lib/way_of_working/changelog/keepachangelog/version.rb:
100
+ comments:
101
+ reviewed_by: timgentry
102
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
103
+ test/test_helper.rb:
104
+ comments:
105
+ reviewed_by: timgentry
106
+ safe_revision: c6967c0cb2b341ab33d5d134af666c0a4e6ade7d
107
+ test/way_of_working/audit_github_stub_classes.rb:
108
+ comments:
109
+ reviewed_by: shilpigoeldev
110
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
111
+ test/way_of_working/changelog/keepachangelog/generators/init_test.rb:
112
+ comments:
113
+ reviewed_by: timgentry
114
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
115
+ test/way_of_working/changelog/keepachangelog/github_audit_rule_test.rb:
116
+ comments:
117
+ reviewed_by: timgentry
118
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
119
+ test/way_of_working/changelog/keepachangelog/zeitwerk_loader_test.rb:
120
+ comments:
121
+ reviewed_by: timgentry
122
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
123
+ test/way_of_working/changelog/keepachangelog_test.rb:
124
+ comments:
125
+ reviewed_by: timgentry
126
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
127
+ way_of_working-changelog-keepachangelog.gemspec:
128
+ comments:
129
+ reviewed_by: timgentry
130
+ safe_revision: 8d28755cd6dce363b605f02a432539c7d6411c33
@@ -0,0 +1,73 @@
1
+ ---
2
+ layout: page
3
+ status: REQUIRED
4
+ enforcement: manual
5
+ ---
6
+
7
+ # Changelog
8
+
9
+ ![Keep a Changelog v1.1.0 badge][changelog-badge]
10
+
11
+ ## Purpose
12
+
13
+ Maintain a human-readable project history that documents all notable changes between versions in plain English.
14
+
15
+ ## Scope
16
+
17
+ All projects must maintain a changelog using [Keep a Changelog v1.1.0][keep-a-changelog] format.
18
+
19
+ ## Requirements
20
+
21
+ - Human-written plain English summaries (not commit log dumps)
22
+ - Entry for every version
23
+ - Latest version listed first
24
+ - Release date displayed for each version
25
+ - Changes grouped by type: `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`
26
+ - Versions and sections must be linkable
27
+ - Follow [Semantic Versioning][semver]
28
+ - Update changelog within Pull Requests, not at release time
29
+
30
+ ## Setup
31
+
32
+ Initialise a changelog for your project:
33
+
34
+ ```bash
35
+ way_of_working init changelog
36
+ ```
37
+
38
+ For git-based projects with existing releases, this scaffolds sections based on semantic version tags.
39
+
40
+ ## Usage
41
+
42
+ 1. Update the `Unreleased` section in each Pull Request
43
+ 2. Group changes under appropriate headings
44
+ 3. Write clear, user-focused descriptions
45
+ 4. Move `Unreleased` changes to a version section at release
46
+ 5. Use scaffolded commit links to document historical changes
47
+
48
+ ## Enforcement
49
+
50
+ - Changelog updates required in Pull Request reviews
51
+ - No automatic commit log dumps permitted
52
+
53
+ ## Examples
54
+
55
+ ```markdown
56
+ ## [1.2.0] - 2025-10-22
57
+
58
+ ### Added
59
+ - User authentication via OAuth2
60
+ - Export data to CSV functionality
61
+
62
+ ### Fixed
63
+ - Memory leak in background job processor
64
+ ```
65
+
66
+ ## Resources
67
+
68
+ - [Keep a Changelog][keep-a-changelog]
69
+ - [Semantic Versioning][semver]
70
+
71
+ [changelog-badge]: https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.1.0-%23E05735
72
+ [keep-a-changelog]: https://keepachangelog.com/en/1.1.0/
73
+ [semver]: https://semver.org
@@ -0,0 +1,119 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'way_of_working/changelog/keepachangelog/paths'
4
+ require 'way_of_working/git/repo_reader'
5
+
6
+ module WayOfWorking
7
+ module Changelog
8
+ module Keepachangelog
9
+ module Generators
10
+ # This class generates the CHANGELOG.md file, generating sections based on
11
+ # git tags and commit messages (where possible).
12
+ class Init < Thor::Group
13
+ include Thor::Actions
14
+
15
+ source_root ::WayOfWorking::Changelog::Keepachangelog.source_root
16
+
17
+ HEADER_TEXT = <<~TEXT
18
+ # Changelog
19
+
20
+ All notable changes to this project will be documented in this file.
21
+
22
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
23
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
24
+
25
+ TEXT
26
+
27
+ def add_changelog_to_project
28
+ create_file 'CHANGELOG.md' do
29
+ HEADER_TEXT + releases + footer
30
+ end
31
+ end
32
+
33
+ def copy_way_of_working_documentation
34
+ copy_file 'docs/way_of_working/changelog.md'
35
+ end
36
+
37
+ private
38
+
39
+ def releases
40
+ text = "## [Unreleased]\n\n"
41
+ text += added_change_text(:minor)
42
+ text += deprecated_removed_fixed_security_text(:minor)
43
+
44
+ summary_tags.each do |summary_tag|
45
+ text += "## [#{summary_tag.version}] - " \
46
+ "#{summary_tag.commit_date.strftime('%Y-%m-%d')}\n\n"
47
+
48
+ text += added_change_text(summary_tag.change_type)
49
+ text += deprecated_removed_fixed_security_text(summary_tag.change_type)
50
+ end
51
+
52
+ text
53
+ end
54
+
55
+ def added_change_text(tag_change_type)
56
+ return '' if tag_change_type == :patch
57
+
58
+ change_text('Added', 'Detail new feature(s) here', true) +
59
+ change_text('Change', 'Detail change(s) in existing functionality here',
60
+ tag_change_type == :major)
61
+ end
62
+
63
+ def deprecated_removed_fixed_security_text(tag_change_type)
64
+ change_text('Deprecated', 'Detail soon-to-be removed features here') +
65
+ change_text('Removed', 'Detail removed features here', tag_change_type == :major) +
66
+ change_text('Fixed', 'Detail any bug fixes here', true) +
67
+ change_text('Security', 'Detail fixes to vulnerabilities here')
68
+ end
69
+
70
+ # This method adds all of the reference style markdown links
71
+ def footer
72
+ return '' if summary_tags.empty?
73
+
74
+ previous_tag = nil
75
+ footer_text = ''
76
+ summary_tags.each do |summary_tag|
77
+ footer_text += if previous_tag
78
+ release_link(summary_tag.name, previous_tag.name, previous_tag.version)
79
+ else
80
+ release_link(summary_tag.name, 'HEAD', 'Unreleased')
81
+ end
82
+
83
+ previous_tag = summary_tag
84
+ end
85
+
86
+ footer_text += "[#{previous_tag.version}]: #{url}/releases/tag/#{previous_tag.name}\n"
87
+
88
+ footer_text
89
+ end
90
+
91
+ def release_link(start_tag, end_tag, version)
92
+ "[#{version}]: #{url}/compare/#{start_tag}...#{end_tag}\n"
93
+ end
94
+
95
+ def change_text(type, description, likely = false)
96
+ text = "### #{type}\n\n- TODO: #{description}"
97
+ text += ' (if any)' unless likely
98
+ text += "\n\n"
99
+ text
100
+ end
101
+
102
+ def repo_reader
103
+ @repo_reader ||= ::WayOfWorking::Git::RepoReader.new(::Git.open('.'))
104
+ end
105
+
106
+ def summary_tags
107
+ @summary_tags ||= repo_reader.summary_tags.reverse
108
+ rescue ArgumentError
109
+ []
110
+ end
111
+
112
+ def url
113
+ @url ||= repo_reader.likely_upstream_remote_url
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'way_of_working/audit/github/rules/base'
4
+
5
+ module WayOfWorking
6
+ module Changelog
7
+ # The namespace for this plugin
8
+ module Keepachangelog
9
+ # This rule checks for the Pull Request template.
10
+ class GithubAuditRule < ::WayOfWorking::Audit::Github::Rules::Base
11
+ def validate
12
+ @errors << 'No Keep a Changelog CHANGELOG.md found' unless keep_a_changelog_found?
13
+ end
14
+
15
+ private
16
+
17
+ def keep_a_changelog_found?
18
+ response = @client.contents(@repo_name, path: 'CHANGELOG.md')
19
+ decoded_content = Base64.decode64(response.content)
20
+
21
+ decoded_content.include?('Keep a Changelog')
22
+ rescue Octokit::NotFound
23
+ false
24
+ end
25
+ end
26
+
27
+ ::WayOfWorking::Audit::Github::Rules::Registry.register(
28
+ GithubAuditRule, 'Keep a Changelog CHANGELOG.md'
29
+ )
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pathname'
4
+
5
+ module WayOfWorking
6
+ module Changelog
7
+ # Mixin that provides a couple of pathname convenience methods
8
+ module Keepachangelog
9
+ class << self
10
+ def root
11
+ Pathname.new(File.expand_path('../../../..', __dir__))
12
+ end
13
+
14
+ def source_root
15
+ root.join('lib', 'way_of_working', 'changelog', 'keepachangelog', 'templates')
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ require 'way_of_working/changelog/keepachangelog'
2
+
3
+ # Add any plug specific code here
4
+
5
+ module WayOfWorking
6
+ module Changelog
7
+ module Keepachangelog
8
+ # This makes zeitwerk happy, which makes us happy too
9
+ module Plugin
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,73 @@
1
+ ---
2
+ layout: page
3
+ status: REQUIRED
4
+ enforcement: manual
5
+ ---
6
+
7
+ # Changelog
8
+
9
+ ![Keep a Changelog v1.1.0 badge][changelog-badge]
10
+
11
+ ## Purpose
12
+
13
+ Maintain a human-readable project history that documents all notable changes between versions in plain English.
14
+
15
+ ## Scope
16
+
17
+ All projects must maintain a changelog using [Keep a Changelog v1.1.0][keep-a-changelog] format.
18
+
19
+ ## Requirements
20
+
21
+ - Human-written plain English summaries (not commit log dumps)
22
+ - Entry for every version
23
+ - Latest version listed first
24
+ - Release date displayed for each version
25
+ - Changes grouped by type: `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`
26
+ - Versions and sections must be linkable
27
+ - Follow [Semantic Versioning][semver]
28
+ - Update changelog within Pull Requests, not at release time
29
+
30
+ ## Setup
31
+
32
+ Initialise a changelog for your project:
33
+
34
+ ```bash
35
+ way_of_working init changelog
36
+ ```
37
+
38
+ For git-based projects with existing releases, this scaffolds sections based on semantic version tags.
39
+
40
+ ## Usage
41
+
42
+ 1. Update the `Unreleased` section in each Pull Request
43
+ 2. Group changes under appropriate headings
44
+ 3. Write clear, user-focused descriptions
45
+ 4. Move `Unreleased` changes to a version section at release
46
+ 5. Use scaffolded commit links to document historical changes
47
+
48
+ ## Enforcement
49
+
50
+ - Changelog updates required in Pull Request reviews
51
+ - No automatic commit log dumps permitted
52
+
53
+ ## Examples
54
+
55
+ ```markdown
56
+ ## [1.2.0] - 2025-10-22
57
+
58
+ ### Added
59
+ - User authentication via OAuth2
60
+ - Export data to CSV functionality
61
+
62
+ ### Fixed
63
+ - Memory leak in background job processor
64
+ ```
65
+
66
+ ## Resources
67
+
68
+ - [Keep a Changelog][keep-a-changelog]
69
+ - [Semantic Versioning][semver]
70
+
71
+ [changelog-badge]: https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.1.0-%23E05735
72
+ [keep-a-changelog]: https://keepachangelog.com/en/1.1.0/
73
+ [semver]: https://semver.org
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WayOfWorking
4
+ module Changelog
5
+ module Keepachangelog
6
+ VERSION = '1.0.0'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'way_of_working'
4
+ require_relative 'keepachangelog/paths'
5
+ require 'zeitwerk'
6
+
7
+ # If way_of_working-audit-github is used we can add a rule
8
+ begin
9
+ require 'way_of_working/audit/github/rules/registry'
10
+ require_relative 'keepachangelog/github_audit_rule'
11
+ rescue LoadError # rubocop:disable Lint/SuppressedException
12
+ end
13
+
14
+ loader = Zeitwerk::Loader.for_gem_extension(WayOfWorking::Changelog)
15
+ loader.setup
16
+
17
+ module WayOfWorking
18
+ module Changelog
19
+ module Keepachangelog
20
+ class Error < StandardError; end
21
+ end
22
+ end
23
+
24
+ module SubCommands
25
+ # This reopens the "way_of_working init" sub command
26
+ class Init
27
+ register(Changelog::Keepachangelog::Generators::Init, 'changelog', 'changelog',
28
+ <<~LONGDESC)
29
+ Description:
30
+ This adds the Keep a Changelog v1.1 changelog to the project
31
+
32
+ Example:
33
+ way_of_working init changelog
34
+
35
+ This will create:
36
+ CHANGELOG.md
37
+ LONGDESC
38
+ end
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: way_of_working-changelog-keepachangelog
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Tim Gentry
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2025-10-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: way_of_working
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: zeitwerk
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.6.18
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.6.18
41
+ description:
42
+ email:
43
+ - 52189+timgentry@users.noreply.github.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".alexrc"
49
+ - ".mega-linter.yml"
50
+ - ".rubocop"
51
+ - CHANGELOG.md
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - code_safety.yml
56
+ - docs/way_of_working/changelog.md
57
+ - lib/way_of_working/changelog/keepachangelog.rb
58
+ - lib/way_of_working/changelog/keepachangelog/generators/init.rb
59
+ - lib/way_of_working/changelog/keepachangelog/github_audit_rule.rb
60
+ - lib/way_of_working/changelog/keepachangelog/paths.rb
61
+ - lib/way_of_working/changelog/keepachangelog/plugin.rb
62
+ - lib/way_of_working/changelog/keepachangelog/templates/docs/way_of_working/changelog.md
63
+ - lib/way_of_working/changelog/keepachangelog/version.rb
64
+ homepage: https://github.com/HealthDataInsight/way_of_working-changelog-keepachangelog
65
+ licenses:
66
+ - MIT
67
+ metadata:
68
+ allowed_push_host: https://rubygems.org
69
+ rubygems_mfa_required: 'true'
70
+ homepage_uri: https://github.com/HealthDataInsight/way_of_working-changelog-keepachangelog
71
+ source_code_uri: https://github.com/HealthDataInsight/way_of_working-changelog-keepachangelog
72
+ changelog_uri: https://github.com/HealthDataInsight/way_of_working-changelog-keepachangelog/blob/main/CHANGELOG.md
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 3.1.0
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubygems_version: 3.3.26
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Way of Working plugin for a Changelog using Keep a Changelog
92
+ test_files: []