way_of_working-for-hdi 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.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.alexignore +2 -0
  3. data/.alexrc +3 -0
  4. data/.mega-linter.yml +145 -0
  5. data/.rubocop +1 -0
  6. data/CHANGELOG.md +27 -0
  7. data/CODE_OF_CONDUCT.md +133 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +77 -0
  10. data/Rakefile +16 -0
  11. data/code_safety.yml +314 -0
  12. data/docs/.gitignore +5 -0
  13. data/docs/404.md +11 -0
  14. data/docs/Gemfile +38 -0
  15. data/docs/Gemfile.lock +293 -0
  16. data/docs/_config.yml +90 -0
  17. data/docs/_includes/components/sidebar.html +69 -0
  18. data/docs/_includes/footer_custom.html +3 -0
  19. data/docs/_sass/color_schemes/hdi-light.scss +31 -0
  20. data/docs/_sass/custom/OneDarkJekyll.scss +203 -0
  21. data/docs/_sass/custom/a11y-colours.scss +4 -0
  22. data/docs/_sass/custom/color-scheme-shims.scss +66 -0
  23. data/docs/_sass/custom/custom.scss +60 -0
  24. data/docs/_sass/custom/setup.scss +3 -0
  25. data/docs/decisions/0000-use-markdown-any-decision-records.md +30 -0
  26. data/docs/decisions/0001-adoption-of-an-off-the-shelf-code-of-conduct.md +34 -0
  27. data/docs/decisions/0002-use-megalinter-for-linting-common-file-formats.md +41 -0
  28. data/docs/decisions/0003-use-keep-a-changelog-v1-1-as-the-format-for-changelogs.md +40 -0
  29. data/docs/decisions/0004-end-to-end-aka-system-testing.md +41 -0
  30. data/docs/decisions/0005-standardised-approach-to-versioning.md +27 -0
  31. data/docs/decisions/0006-standard-approach-to-automated-accessibility-testing.md +54 -0
  32. data/docs/decisions/0007-test-for-insensitive-and-inconsiderate-writing.md +32 -0
  33. data/docs/decisions/0008-software-as-a-service-saas-web-analytics-solution.md +30 -0
  34. data/docs/decisions/0009-pull-request-guidlines-and-template.md +31 -0
  35. data/docs/decisions/README.md +7 -0
  36. data/docs/decisions/adr-template.md +82 -0
  37. data/docs/decisions/index.md +48 -0
  38. data/docs/index.md +33 -0
  39. data/docs/pa11y.json +9 -0
  40. data/docs/way_of_working/accessibility-testing.md +29 -0
  41. data/docs/way_of_working/changelog.md +58 -0
  42. data/docs/way_of_working/code-linting/index.md +39 -0
  43. data/docs/way_of_working/code-linting/linters.md +153 -0
  44. data/docs/way_of_working/code-of-conduct.md +31 -0
  45. data/docs/way_of_working/decision-records.md +58 -0
  46. data/docs/way_of_working/end-to-end-testing.md +35 -0
  47. data/docs/way_of_working/inclusive-language.md +28 -0
  48. data/docs/way_of_working/pull-request-template-and-guidelines.md +18 -0
  49. data/docs/way_of_working/readme-badges.md +24 -0
  50. data/docs/way_of_working/versioning.md +25 -0
  51. data/lib/way_of_working/for/hdi/paths.rb +20 -0
  52. data/lib/way_of_working/for/hdi/plugin.rb +12 -0
  53. data/lib/way_of_working/for/hdi/version.rb +9 -0
  54. data/lib/way_of_working/for/hdi.rb +23 -0
  55. data/lib/way_of_working/rake_tasks/generators/init.rb +47 -0
  56. data/lib/way_of_working/rake_tasks.rb +22 -0
  57. metadata +257 -0
@@ -0,0 +1,153 @@
1
+ ---
2
+ layout: page
3
+ nav_order: 1
4
+ parent: Code Linting
5
+ ---
6
+
7
+ # Linters
8
+
9
+ The following tables detail the linters that we are currently using:
10
+
11
+ ## Languages
12
+
13
+ | Language | Linter | Details |
14
+ |:-------------|:--------------------------------------|:--------------------------------------------------------------------------------|
15
+ | Bash | BASH_EXEC | [bash-exec](https://megalinter.io/latest/descriptors/bash_bash_exec/) |
16
+ | Bash | BASH_SHELLCHECK | [shellcheck](https://megalinter.io/latest/descriptors/bash_shellcheck/) |
17
+ | Bash | BASH_SHFMT | [shfmt](https://megalinter.io/latest/descriptors/bash_shfmt/) |
18
+ | C | C_CLANG_FORMAT | [clang-format](https://megalinter.io/latest/descriptors/c_clang_format/) |
19
+ | C | C_CPPLINT | [cpplint](https://megalinter.io/latest/descriptors/c_cpplint/) |
20
+ | C# | CSHARP_CSHARPIER | [csharpier](https://megalinter.io/latest/descriptors/csharp_csharpier/) |
21
+ | C# | CSHARP_DOTNET_FORMAT | [dotnet-format](https://megalinter.io/latest/descriptors/csharp_dotnet_format/) |
22
+ | C# | CSHARP_ROSLYNATOR | [roslynator](https://megalinter.io/latest/descriptors/csharp_roslynator/) |
23
+ | C++ | CPP_CLANG_FORMAT | [clang-format](https://megalinter.io/latest/descriptors/cpp_clang_format/) |
24
+ | C++ | CPP_CPPLINT | [cpplint](https://megalinter.io/latest/descriptors/cpp_cpplint/) |
25
+ | Clojure | ~~CLOJURE_CLJSTYLE~~ | Not Used |
26
+ | Clojure | ~~CLOJURE_CLJ_KONDO~~ | Not Used |
27
+ | CoffeeScript | COFFEE_COFFEELINT | [coffeelint](https://megalinter.io/latest/descriptors/coffee_coffeelint/) |
28
+ | Dart | DART_DARTANALYZER | [dartanalyzer](https://megalinter.io/latest/descriptors/dart_dartanalyzer/) |
29
+ | Go | GO_GOLANGCI_LINT | [golangci-lint](https://megalinter.io/latest/descriptors/go_golangci_lint/) |
30
+ | Go | GO_REVIVE | [revive](https://megalinter.io/latest/descriptors/go_revive/) |
31
+ | Groovy | ~~GROOVY_NPM_GROOVY_LINT~~ | Not Used |
32
+ | Java | JAVA_CHECKSTYLE | [checkstyle](https://megalinter.io/latest/descriptors/java_checkstyle/) |
33
+ | Java | JAVA_PMD | [pmd](https://megalinter.io/latest/descriptors/java_pmd/) |
34
+ | JavaScript | JAVASCRIPT_ES | [eslint](https://megalinter.io/latest/descriptors/javascript_eslint/) |
35
+ | JavaScript | ~~JAVASCRIPT_PRETTIER~~ | Not Used |
36
+ | JavaScript | JAVASCRIPT_STANDARD | [standard](https://megalinter.io/latest/descriptors/javascript_standard/) |
37
+ | JSX | JSX_ESLINT | [eslint](https://megalinter.io/latest/descriptors/jsx_eslint/) |
38
+ | Kotlin | KOTLIN_DETEKT | [detekt](https://megalinter.io/latest/descriptors/kotlin_detekt/) |
39
+ | Kotlin | KOTLIN_KTLINT | [ktlint](https://megalinter.io/latest/descriptors/kotlin_ktlint/) |
40
+ | Lua | ~~LUA_LUACHECK~~ | Not Used |
41
+ | Lua | ~~LUA_SELENE~~ | Not Used |
42
+ | Lua | ~~LUA_STYLUA~~ | Not Used |
43
+ | Makefile | MAKEFILE_CHECKMAKE | [checkmake](https://megalinter.io/latest/descriptors/makefile_checkmake/) |
44
+ | Perl | ~~PERL_PERLCRITIC~~ | Not Used |
45
+ | PHP | ~~PHP_PHPCS~~ | Not Used |
46
+ | PHP | ~~PHP_PHPCSFIXER~~ | Not Used |
47
+ | PHP | ~~PHP_PHPLINT~~ | Not Used |
48
+ | PHP | ~~PHP_PHPSTAN~~ | Not Used |
49
+ | PHP | ~~PHP_PSALM~~ | Not Used |
50
+ | Powershell | ~~POWERSHELL_POWERSHELL~~ | Not Used |
51
+ | Powershell | ~~POWERSHELL_POWERSHELL_FORMATTER~~ | Not Used |
52
+ | Python | PYTHON_BANDIT | [bandit](https://megalinter.io/latest/descriptors/python_bandit/) |
53
+ | Python | PYTHON_BLACK | [black](https://megalinter.io/latest/descriptors/python_black/) |
54
+ | Python | PYTHON_FLAKE8 | [flake8](https://megalinter.io/latest/descriptors/python_flake8/) |
55
+ | Python | PYTHON_ISORT | [isort](https://megalinter.io/latest/descriptors/python_isort/) |
56
+ | Python | PYTHON_MYPY | [mypy](https://megalinter.io/latest/descriptors/python_mypy/) |
57
+ | Python | PYTHON_PYLINT | [pylint](https://megalinter.io/latest/descriptors/python_pylint/) |
58
+ | Python | PYTHON_PYRIGHT | [pyright](https://megalinter.io/latest/descriptors/python_pyright/) |
59
+ | Python | PYTHON_RUFF | [ruff](https://megalinter.io/latest/descriptors/python_ruff/) |
60
+ | R | R_LINTR | [lintr](https://megalinter.io/latest/descriptors/r_lintr/) |
61
+ | Raku | ~~RAKU_RAKU~~ | Not Used |
62
+ | Ruby | ~~RUBY_RUBOCOP~~ | Not Used (RuboCop is used directly) |
63
+ | Rust | RUST_CLIPPY | [clippy](https://megalinter.io/latest/descriptors/rust_clippy/) |
64
+ | Salesforce | ~~SALESFORCE_LIGHTNING_FLOW_SCANNER~~ | Not Used |
65
+ | Salesforce | ~~SALESFORCE_SFDX_SCANNER_APEX~~ | Not Used |
66
+ | Salesforce | ~~SALESFORCE_SFDX_SCANNER_AURA~~ | Not Used |
67
+ | Salesforce | ~~SALESFORCE_SFDX_SCANNER_LWC~~ | Not Used |
68
+ | Scala | SCALA_SCALAFIX | [scalafix](https://megalinter.io/latest/descriptors/scala_scalafix/) |
69
+ | SQL | SQL_SQLFLUFF | [sqlfluff](https://megalinter.io/latest/descriptors/sql_sqlfluff/) |
70
+ | SQL | SQL_TSQLLINT | [tsqllint](https://megalinter.io/latest/descriptors/sql_tsqllint/) |
71
+ | Swift | SWIFT_SWIFTLINT | [swiftlint](https://megalinter.io/latest/descriptors/swift_swiftlint/) |
72
+ | TSX | TSX_ESLINT | [eslint](https://megalinter.io/latest/descriptors/tsx_eslint/) |
73
+ | TypeScript | TYPESCRIPT_ES | [eslint](https://megalinter.io/latest/descriptors/typescript_eslint/) |
74
+ | TypeScript | ~~TYPESCRIPT_PRETTIER~~ | Not Used |
75
+ | TypeScript | TYPESCRIPT_STANDARD | [ts-standard](https://megalinter.io/latest/descriptors/typescript_ts_standard/) |
76
+ | VB.Net | ~~VBDOTNET_DOTNET_FORMAT~~ | Not Used |
77
+
78
+ ## Formats
79
+
80
+ | Format | Linter | Details |
81
+ |:-----------------|:----------------------------------|:--------------------------------------------------------------------------------------------------------|
82
+ | CSS | CSS_STYLELINT | [stylelint](https://megalinter.io/latest/descriptors/css_stylelint/) |
83
+ | ENV | ENV_DOTENV_LINTER | [dotenv-linter](https://megalinter.io/latest/descriptors/env_dotenv_linter/) |
84
+ | GraphQL | ~~GRAPHQL_GRAPHQL_SCHEMA_LINTER~~ | Not Used |
85
+ | HTML | ~~HTML_DJLINT~~ | Not Used (Refuses to see config file) |
86
+ | HTML | HTML_HTMLHINT | [htmlhint](https://megalinter.io/latest/descriptors/html_htmlhint/) |
87
+ | JSON | JSON_ESLINT_PLUGIN_JSONC | [eslint-plugin-jsonc](https://megalinter.io/latest/descriptors/json_eslint_plugin_jsonc/) |
88
+ | JSON | JSON_JSONLINT | [jsonlint](https://megalinter.io/latest/descriptors/json_jsonlint/) |
89
+ | JSON | JSON_NPM_PACKAGE_JSON_LINT | [npm-package-json-lint](https://megalinter.io/latest/descriptors/json_npm_package_json_lint/) |
90
+ | JSON | ~~JSON_PRETTIER~~ | Not Used |
91
+ | JSON | JSON_V8R | [v8r](https://megalinter.io/latest/descriptors/json_v8r/) |
92
+ | LaTeX | ~~LATEX_CHKTEX~~ | Not Used |
93
+ | Markdown | MARKDOWN_MARKDOWNLINT | [markdownlint](https://megalinter.io/latest/descriptors/markdown_markdownlint/) |
94
+ | Markdown | MARKDOWN_MARKDOWN_LINK_CHECK | [markdown-link-check](https://megalinter.io/latest/descriptors/markdown_markdown_link_check/) |
95
+ | Markdown | MARKDOWN_MARKDOWN_TABLE_FORMATTER | [markdown-table-formatter](https://megalinter.io/latest/descriptors/markdown_markdown_table_formatter/) |
96
+ | Markdown | MARKDOWN_REMARK_LINT | [remark-lint](https://megalinter.io/latest/descriptors/markdown_remark_lint/) |
97
+ | Protocol Buffers | ~~PROTOBUF_PROTOLINT~~ | Not Used |
98
+ | reStructuredText | ~~RST_RSTCHECK~~ | Not Used |
99
+ | reStructuredText | ~~RST_RSTFMT~~ | Not Used |
100
+ | reStructuredText | ~~RST_RST_LINT~~ | Not Used |
101
+ | XML | XML_XMLLINT | [xmllint](https://megalinter.io/latest/descriptors/xml_xmllint/) |
102
+ | YAML | ~~YAML_PRETTIER~~ | Not Used |
103
+ | YAML | YAML_V8R | [v8r](https://megalinter.io/latest/descriptors/yaml_v8r/) |
104
+ | YAML | YAML_YAMLLINT | [yamllint](https://megalinter.io/latest/descriptors/yaml_yamllint/) |
105
+
106
+ ## Tooling formats
107
+
108
+ | Tooling format | Linter | Details |
109
+ |:---------------|:----------------------------------|:----------------------------------------------------------------------------------------------------|
110
+ | GitHub Action | ACTION_ACTIONLINT | [actionlint](https://megalinter.io/latest/descriptors/action_actionlint/) |
111
+ | Ansible | ANSIBLE_ANSIBLE_LINT | [ansible-lint](https://megalinter.io/latest/descriptors/ansible_ansible_lint/) |
112
+ | Api | API_SPECTRAL | [spectral](https://megalinter.io/latest/descriptors/api_spectral/) |
113
+ | ARM Templates | ARM_ARM_TTK | [arm-ttk](https://megalinter.io/latest/descriptors/arm_arm_ttk/) |
114
+ | Bicep | ~~BICEP_BICEP_LINTER~~ | Not Used |
115
+ | CloudFormation | CLOUDFORMATION_CFN_LINT | [cfn-lint](https://megalinter.io/latest/descriptors/cloudformation_cfn_lint/) |
116
+ | Dockerfile | DOCKERFILE_HADOLINT | [hadolint](https://megalinter.io/latest/descriptors/dockerfile_hadolint/) |
117
+ | EditorConfig | EDITORCONFIG_EDITORCONFIG_CHECKER | [editorconfig-checker](https://megalinter.io/latest/descriptors/editorconfig_editorconfig_checker/) |
118
+ | Gherkin | ~~GHERKIN_GHERKIN_LINT~~ | Not Used |
119
+ | Kubernetes | KUBERNETES_HELM | [helm](https://megalinter.io/latest/descriptors/kubernetes_helm/) |
120
+ | Kubernetes | KUBERNETES_KUBECONFORM | [kubeconform](https://megalinter.io/latest/descriptors/kubernetes_kubeconform/) |
121
+ | Kubernetes | KUBERNETES_KUBESCAPE | [kubescape](https://megalinter.io/latest/descriptors/kubernetes_kubescape/) |
122
+ | Puppet | PUPPET_PUPPET_LINT | [puppet-lint](https://megalinter.io/latest/descriptors/puppet_puppet_lint/) |
123
+ | Snakemake | ~~SNAKEMAKE_LINT~~ | Not Used |
124
+ | Snakemake | ~~SNAKEMAKE_SNAKEFMT~~ | Not Used |
125
+ | Tekton | ~~TEKTON_TEKTON_LINT~~ | Not Used |
126
+ | Terraform | TERRAFORM_TERRAFORM_FMT | [terraform-fmt](https://megalinter.io/latest/descriptors/terraform_terraform_fmt/) |
127
+ | Terraform | TERRAFORM_TERRAGRUNT | [terragrunt](https://megalinter.io/latest/descriptors/terraform_terragrunt/) |
128
+ | Terraform | TERRAFORM_TERRASCAN | [terrascan](https://megalinter.io/latest/descriptors/terraform_terrascan/) |
129
+ | Terraform | TERRAFORM_TFLINT | [tflint](https://megalinter.io/latest/descriptors/terraform_tflint/) |
130
+
131
+ ## Other
132
+
133
+ | Other | Linter | Details |
134
+ |:-----------|:----------------------|:------------------------------------------------------------------------------|
135
+ | Copypaste | COPYPASTE_JSCPD | [jscpd](https://megalinter.io/latest/descriptors/copypaste_jscpd/) |
136
+ | Repository | REPOSITORY_CHECKOV | [checkov](https://megalinter.io/latest/descriptors/repository_checkov/) |
137
+ | Repository | REPOSITORY_DEVSKIM | [devskim](https://megalinter.io/latest/descriptors/repository_devskim/) |
138
+ | Repository | REPOSITORY_DUSTILOCK | [dustilock](https://megalinter.io/latest/descriptors/repository_dustilock/) |
139
+ | Repository | REPOSITORY_GITLEAKS | [gitleaks](https://megalinter.io/latest/descriptors/repository_gitleaks/) |
140
+ | Repository | REPOSITORY_GIT_DIFF | [git_diff](https://megalinter.io/latest/descriptors/repository_git_diff/) |
141
+ | Repository | REPOSITORY_GRYPE | [grype](https://megalinter.io/latest/descriptors/repository_grype/) |
142
+ | Repository | REPOSITORY_KICS | [kics](https://megalinter.io/latest/descriptors/repository_kics/) |
143
+ | Repository | REPOSITORY_LS_LINT | [ls-lint](https://megalinter.io/latest/descriptors/repository_ls_lint/) |
144
+ | Repository | REPOSITORY_SECRETLINT | [secretlint](https://megalinter.io/latest/descriptors/repository_secretlint/) |
145
+ | Repository | REPOSITORY_SEMGREP | [semgrep](https://megalinter.io/latest/descriptors/repository_semgrep/) |
146
+ | Repository | REPOSITORY_SYFT | [syft](https://megalinter.io/latest/descriptors/repository_syft/) |
147
+ | Repository | REPOSITORY_TRIVY | [trivy](https://megalinter.io/latest/descriptors/repository_trivy/) |
148
+ | Repository | REPOSITORY_TRIVY_SBOM | [trivy-sbom](https://megalinter.io/latest/descriptors/repository_trivy_sbom/) |
149
+ | Repository | REPOSITORY_TRUFFLEHOG | [trufflehog](https://megalinter.io/latest/descriptors/repository_trufflehog/) |
150
+ | Spelling | ~~SPELL_CSPELL~~ | Not Used |
151
+ | Spelling | SPELL_LYCHEE | [lychee](https://megalinter.io/latest/descriptors/spell_lychee/) |
152
+ | Spelling | SPELL_PROSELINT | [proselint](https://megalinter.io/latest/descriptors/spell_proselint/) |
153
+ | Spelling | SPELL_VALE | [vale](https://megalinter.io/latest/descriptors/spell_vale/) |
@@ -0,0 +1,31 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+ # Code of Conduct
5
+
6
+ We have adopted the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) Code of Conduct v2.1
7
+
8
+ Using the Contributor Covenant Code of Conduct benefits any community or project by setting clear expectations for acceptable behaviour and creating a safer and more inclusive environment for everyone involved.
9
+ The Code of Conduct establishes guidelines for respectful communication and conduct and consequences for inappropriate behaviour. By adhering to these guidelines, community members can build trust and mutual respect, which fosters a more collaborative and productive environment.
10
+
11
+ The Contributor Covenant is specifically designed to promote diversity and inclusion within communities and projects. It includes provisions to prevent discrimination and harassment based on factors such as race, gender, sexual orientation, and ability. By adopting and enforcing the Code of Conduct, communities can create a more welcoming and supportive environment for underrepresented groups.
12
+
13
+ In addition to promoting a positive and inclusive environment, the Contributor Covenant can help prevent conflicts and misunderstandings by providing a clear set of expectations for behaviour, reducing the likelihood of interpersonal conflicts and creating a more harmonious community.
14
+ Projects and communities can establish a strong foundation for healthy collaboration and growth using the Contributor Covenant Code of Conduct.
15
+
16
+ {: .important }
17
+ Adopting the Contributor Covenant Code of Conduct involves more than only adding a `CODE_OF_CONDUCT.md` file to the root of your project.
18
+ Please thoroughly read the [enforcement guidelines](https://www.contributor-covenant.org/version/2/1/code_of_conduct/#enforcement-guidelines) section of the code and discuss the implications of adopting the code of conduct with your team.
19
+
20
+ ## Usage
21
+
22
+ ### Adding the Code of Conduct to your project
23
+
24
+ To add a [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) Code of Conduct v2.1 to your project, use the following at the command line:
25
+
26
+ way_of_working init code_of_conduct --contact-method [CONTACT METHOD]
27
+
28
+ You will need to enter a contact method, usually an email address.
29
+
30
+ {: .note }
31
+ We recommend that you use the HDI code of conduct email address as the contact method.
@@ -0,0 +1,58 @@
1
+ ---
2
+ has_children: true
3
+ ---
4
+ # Decision Records
5
+
6
+ We use [Markdown Any Decision Records (MADR)](https://adr.github.io/madr/) version 3.0.0.
7
+
8
+ In general, projects will follow the [Way of Working](https://github.com/HealthDataInsight/way_of_working) and so decisions captured within individual projects will generally cover decisions that:
9
+
10
+ - are not already covered in the Way of Working
11
+ - are covered in the Way of Working, but have specific implementation details which need to be captured
12
+ - diverge from the guidance in the Way of Working
13
+
14
+ You can read about the general approach to capturing decisions on the [GDS Way page on Architecture Decisions](https://gds-way.cloudapps.digital/standards/architecture-decisions.html) and specifics about MADR are available at <https://adr.github.io/madr/>.
15
+
16
+ Proposing and reviewing decisions requires an understanding of GitHub and [pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).
17
+
18
+ ## Usage
19
+
20
+ ### Adding Markdown Any Decision Records to your project
21
+
22
+ To add the MADR v3.0.0 framework to your project, run the following at the command line:
23
+
24
+ ```bash
25
+ way_of_working init decision_record
26
+ ```
27
+
28
+ ### Create a new decision record
29
+
30
+ #### Manual approach
31
+
32
+ 1. Copy `docs/decisions/adr-template.md` to `docs/decisions/NNNN-title-with-dashes.md`, where `NNNN` indicates the next number in sequence.
33
+ 2. Edit `NNNN-title-with-dashes.md`.
34
+
35
+ Note you can also use [other patterns for the directory format](https://github.com/joelparkerhenderson/architecture_decision_record#adr-file-name-conventions).
36
+ As a consequence, some existing tooling might not be applicable.
37
+
38
+ The filenames are following the pattern `NNNN-title-with-dashes.md`, where
39
+
40
+ - `NNNN` is a consecutive number and we assume that there won't be more than 9,999 ADRs in one repository.
41
+ - the title is stored using dashes and lowercase, because [adr-tools] also does that.
42
+ - the suffix is `.md`, because it is a [Markdown](https://github.github.com/gfm/) file.
43
+
44
+ Decisions are placed in the subfolder `decisions/` to keep them close to the documentation but also separate the decisions from other documentation.
45
+
46
+ #### Automatic approach
47
+
48
+ To create a new decision record, run:
49
+
50
+ ```bash
51
+ way_of_working new decision_record [NAME]
52
+ ```
53
+
54
+ Where `[NAME]` is the title of your decision record, for example:
55
+
56
+ ```bash
57
+ way_of_working new decision_record "Use Markdown Any Decision Records"
58
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+
5
+ # End-to-End Testing
6
+
7
+ We have adopted [Cypress](https://www.cypress.io) for end-to-end web application testing.
8
+
9
+ End-to-end testing (also known as system testing) is essential to the software development lifecycle, especially for web applications. End-to-end tests help ensure that all the application components work together as intended, from the front-end user interface to the server-side back-end functionality. In addition, end-to-end tests can help catch issues that may not be apparent in unit or integration tests by testing the entire application flow.
10
+
11
+ One of the primary benefits of end-to-end testing is that it helps improve the overall quality of the web application. By testing the entire application flow, developers can identify and fix issues early on before they become significant problems that impact the user experience. End-to-end tests can also help ensure that new features or changes to existing features do not introduce regressions that negatively affect the user experience.
12
+
13
+ End-to-end testing can also help reduce the risk of downtime or data loss. End-to-end tests can help prevent costly downtime and data loss by catching issues before they impact production environments. Additionally, end-to-end tests can help ensure that the application is working as expected after updates or changes to the infrastructure, such as deploying to a new server or upgrading to a recent version of a framework or library.
14
+
15
+ Overall, writing end-to-end tests for web applications is critical to ensuring the application's quality and reliability. By testing the entire application flow, developers can catch issues early on and reduce the risk of downtime or data loss. Additionally, end-to-end tests can help improve the overall user experience by ensuring the application works as expected.
16
+
17
+ ## Usage
18
+
19
+ ### Adding Cypress to your Rails project
20
+
21
+ In order to not delay the decision to adopt Cypress, the automated Rails initialisation tooling will be added later. For now, please follow the [cypress-rails](https://github.com/testdouble/cypress-rails) instructions.
22
+
23
+ For information on using cypress, visit <https://github.com/testdouble/cypress-rails#usage>.
24
+
25
+ ### Adding Cypress to other projects
26
+
27
+ To add Cypress to non-Rails projects, please follow the official instructions on [installing Cypress](https://docs.cypress.io/guides/getting-started/installing-cypress).
28
+
29
+ ### Writing tests
30
+
31
+ The Cypress documentation is excellent, but here are a few good starting points:
32
+
33
+ * [Writing Your First End-to-End Test](https://docs.cypress.io/guides/end-to-end-testing/writing-your-first-end-to-end-test)
34
+ * [Introduction to Cypress](https://docs.cypress.io/guides/core-concepts/introduction-to-cypress)
35
+ * [Best Practices](https://docs.cypress.io/guides/references/best-practices)
@@ -0,0 +1,28 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+
5
+ # Inclusive Language
6
+
7
+ We have adopted [alex](https://alexjs.com) for automated testing of inclusive language.
8
+
9
+ Using insensitive and inconsiderate language can cause harm to others, create barriers to communication, and damage relationships. It can make people feel excluded, disrespected, and devalued and may perpetuate negative stereotypes and biases. When we use insensitive or offensive language, we undermine our ability to connect with others and build trust.
10
+
11
+ Therefore, it is essential to be mindful of the impact of our words and to choose language that is respectful, inclusive, and considerate of others. Doing so can create a more welcoming and inclusive environment for everyone, fostering greater understanding, empathy, and cooperation.
12
+
13
+ To quote from the alex README:
14
+
15
+ > No automated tool can replace studying inclusive communication and listening to the lived experiences of others. **An error from alex can be an invitation to learn more**.
16
+
17
+ {: .important }
18
+ Please take the opportunity to read some of the [further reading](https://github.com/get-alex/alex#further-reading) they reference and click on the links against individual warnings when they appear.
19
+
20
+ ## Usage
21
+
22
+ To add alex to your project, run the following at the command line:
23
+
24
+ way_of_working init inclusive_language
25
+
26
+ to run alex in your project, run:
27
+
28
+ way_of_working exec inclusive_language
@@ -0,0 +1,18 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+
5
+ # Pull Request Template and Guidelines
6
+
7
+ A Pull Request (PR) template offers multiple benefits to a development team. It standardizes the process of contributing changes, making it easier for both the author and the reviewers to understand the context of the changes. PR templates can ensure that necessary details, such as a summary of the changes, the reason for the changes (the 'why'), and any associated issue or ticket numbers, are consistently provided. This helps in maintaining a clean, organized, and searchable project history.
8
+
9
+ Moreover, by setting clear expectations about the information that should be included in a PR, templates can streamline the review process, reduce the likelihood of misunderstandings, and ultimately lead to higher-quality code and a more productive team.
10
+
11
+ {: .important }
12
+ A Pull Request doesn't begin and end with the template, the tone of the request and any subsequent feedback is also very important. Alongside the [Code of Conduct](code-of-conduct.md), please read GitHub's PR communication guidelines in [How to write the perfect pull request](https://github.blog/2015-01-21-how-to-write-the-perfect-pull-request/).
13
+
14
+ ## Usage
15
+
16
+ To add the Pull Request template to your project, use the following at the command line:
17
+
18
+ way_of_working init pull_request_template
@@ -0,0 +1,24 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+ # README Badges
5
+
6
+ Badges at the top of a project's README file are a powerful tool for providing immediate, concise, and digestible information about a project.
7
+
8
+ They are an important feature, as they communicate crucial insights such as the build status, test coverage, package version, licensing information, or even the platform compatibility of the project, all at a glance. Badges allow developers to quickly gauge the project's health, and maintenance level, without delving into the project's codebase or documentation.
9
+
10
+ Moreover, badges can help foster a sense of openness and reliability within the open-source community, as they provide a transparent snapshot of the project's current state. This makes them essential to building trust and confidence in a project, which can facilitate broader adoption and community involvement.
11
+
12
+ Our badge "panel" is a set of predefined HTML comments that top and tail Way of Working badges in the README, so that other generators within the framework can automatically find the panel and add their badge(s) to it.
13
+
14
+ ![HDI Way of Working Badge](https://img.shields.io/badge/HDI_Way_of_Working-v1.0.0-%238169e3?labelColor=black)
15
+
16
+ We have created a Way of Working badge to identify at a glance that a project has adopted the Way of Working.
17
+
18
+ ## Usage
19
+
20
+ To add the badge "panel" and Way of Working badge to your project, use the following at the command line:
21
+
22
+ ```bash
23
+ way_of_working init readme_badge
24
+ ```
@@ -0,0 +1,25 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+
5
+ # Versioning
6
+
7
+ We have adopted [Semantic Versioning](https://semver.org) as our versioning system.
8
+
9
+ Semantic Versioning, or "semver" for short, is a versioning system developers use to communicate effectively about the changes made to their software. Semver consists of three numbers separated by dots, with each number representing a different aspect of the software's version. The first number indicates a major release, the second number indicates a minor release, and the third number indicates a patch release.
10
+
11
+ From the website:
12
+
13
+ > Given a version number MAJOR.MINOR.PATCH, increment the:
14
+ >
15
+ > 1. MAJOR version when you make incompatible API changes
16
+ > 2. MINOR version when you add functionality in a backwards compatible manner
17
+ > 3. PATCH version when you make backwards compatible bug fixes
18
+ >
19
+ > Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
20
+
21
+ Following the semver format, developers can tell users and other developers what has changed in each release and whether the changes are significant enough to require an update. This helps users and other developers make informed decisions about whether to update their software and also helps to prevent confusion and errors caused by incompatible software versions.
22
+
23
+ Using the same versioning system across different projects allows developers to compare and understand the differences between software releases quickly. Additionally, semver provides a framework for planning and organizing future development, as developers can use the version numbers to indicate their plans for future releases.
24
+
25
+ Semantic versioning is a good practice for developers because it improves communication and consistency, helps users and other developers make informed decisions about updating their software, and provides a framework for planning and organizing future development.
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pathname'
4
+
5
+ module WayOfWorking
6
+ module For
7
+ # Mixin that provides a couple of pathname convenience methods
8
+ module Hdi
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', 'for', 'hdi', 'templates')
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,12 @@
1
+ require 'way_of_working/for/hdi'
2
+
3
+ # Add any plug specific code here
4
+ module WayOfWorking
5
+ module For
6
+ module Hdi
7
+ # This makes zeitwerk happy, which makes us happy too
8
+ module Plugin
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WayOfWorking
4
+ module For
5
+ module Hdi
6
+ VERSION = '1.0.0'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'way_of_working'
4
+ require_relative 'hdi/paths'
5
+ require 'zeitwerk'
6
+
7
+ loader = Zeitwerk::Loader.for_gem_extension(WayOfWorking::For)
8
+ loader.setup
9
+
10
+ # Require "internal" plugin(s) here
11
+ require 'way_of_working/rake_tasks'
12
+
13
+ module WayOfWorking
14
+ module For
15
+ module Hdi
16
+ class Error < StandardError; end
17
+ end
18
+ end
19
+
20
+ # Configure HDI-specific settings
21
+ Configuration.organisation_abbreviation = 'HDI'
22
+ Configuration.organisation_gem_version = For::Hdi::VERSION
23
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WayOfWorking
4
+ module RakeTasks
5
+ module Generators
6
+ # This generator installs way of working rake tasks into this project
7
+ class Init < Thor::Group
8
+ include Thor::Actions
9
+
10
+ RAKEFILE_FILENAME = 'Rakefile'
11
+ RAILS_LOC = %r{require_relative ["']config/application["']\n}
12
+ BUNDLER_LOC = %r{require ["']bundler/gem_tasks["']\n}
13
+
14
+ def add_to_rakefile
15
+ case rakefile_type
16
+ when :rails
17
+ inject_into_file RAKEFILE_FILENAME,
18
+ "require 'way_of_working/tasks' if Rails.env.development? " \
19
+ "|| Rails.env.test?\n",
20
+ after: RAILS_LOC
21
+ when :bundler
22
+ inject_into_file RAKEFILE_FILENAME,
23
+ "require 'way_of_working/tasks'\n",
24
+ after: BUNDLER_LOC
25
+ when :none
26
+ create_file RAKEFILE_FILENAME, "\nrequire 'way_of_working/tasks'\n"
27
+ else
28
+ append_to_file RAKEFILE_FILENAME, "\nrequire 'way_of_working/tasks'\n"
29
+ end
30
+ end
31
+
32
+ private
33
+
34
+ def rakefile_type
35
+ content = File.read(File.expand_path(RAKEFILE_FILENAME, destination_root))
36
+
37
+ return :rails if content.match?(RAILS_LOC)
38
+ return :bundler if content.match?(BUNDLER_LOC)
39
+
40
+ :other
41
+ rescue Errno::ENOENT
42
+ :none
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'rake_tasks/generators/init'
4
+
5
+ module WayOfWorking
6
+ module SubCommands
7
+ # This reopens the "way_of_working init" sub command
8
+ class Init
9
+ register(WayOfWorking::RakeTasks::Generators::Init, 'rake_tasks', 'rake_tasks',
10
+ <<~LONGDESC)
11
+ Description:
12
+ Installs Way of Working rake tasks into this project
13
+
14
+ Example:
15
+ way_of_working init rake_tasks
16
+
17
+ This will amend or create:
18
+ Rakefile
19
+ LONGDESC
20
+ end
21
+ end
22
+ end