way_of_working-inclusive_language-alex 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b4cc57c1a43843e292dd345f897327d08b8e87c6d3449751aa92429327f95eb3
4
+ data.tar.gz: 57c2222badd862a9af214dfc160a3e6abebd682470b49502c64efb55cd15d9e3
5
+ SHA512:
6
+ metadata.gz: 1c5e58dc0f7a700c5338cc1cf474e715a1bd18ca9b66141d8ccc779bd063a1d2a6b46981ccd4fdb262d916ef35b8a0d92d0b5ac6ab46698990cc3df1b613508b
7
+ data.tar.gz: d6675bceed02fb0647a785890a1bcf9503cdfa8ddd407f3475d8cb13aaa83cc1806b84f2e8c6baa9a26c2fa3454dd424f0fa7a76a8f8ae5dc84a745e81235593
data/.alexrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "profanitySureness": 1
3
+ }
data/.mega-linter.yml ADDED
@@ -0,0 +1,129 @@
1
+ ---
2
+ # Configuration file for MegaLinter
3
+ # See all available variables at https://megalinter.io/configuration/ and in linters documentation
4
+
5
+ APPLY_FIXES: none # all, none, or list of linter keys
6
+ ENABLE_LINTERS: # If you use ENABLE_LINTERS variable, all other linters will be disabled by default
7
+ ### Languages
8
+ - BASH_EXEC # in Super-Linter
9
+ - BASH_SHELLCHECK # in Super-Linter
10
+ - BASH_SHFMT # in Super-Linter
11
+ - C_CPPLINT
12
+ # - CLOJURE_CLJ_KONDO # in Super-Linter
13
+ - COFFEE_COFFEELINT # in Super-Linter
14
+ - CPP_CPPLINT # in Super-Linter
15
+ - CSHARP_DOTNET_FORMAT # in Super-Linter
16
+ - DART_DARTANALYZER # in Super-Linter
17
+ - GO_GOLANGCI_LINT # in Super-Linter
18
+ - GO_REVIVE
19
+ # - GROOVY_NPM_GROOVY_LINT # in Super-Linter
20
+ - JAVA_CHECKSTYLE # in Super-Linter
21
+ - JAVA_PMD
22
+ - JAVASCRIPT_ES # in Super-Linter
23
+ # - JAVASCRIPT_PRETTIER
24
+ - JAVASCRIPT_STANDARD # in Super-Linter
25
+ - JSX_ESLINT
26
+ - KOTLIN_KTLINT # in Super-Linter
27
+ # - LUA_LUACHECK # in Super-Linter
28
+ - MAKEFILE_CHECKMAKE
29
+ # - PERL_PERLCRITIC # in Super-Linter
30
+ # - PHP_PHPCS # in Super-Linter
31
+ # - PHP_PHPLINT # in Super-Linter
32
+ # - PHP_PHPSTAN # in Super-Linter
33
+ # - PHP_PSALM # in Super-Linter
34
+ # - POWERSHELL_POWERSHELL
35
+ # - POWERSHELL_POWERSHELL_FORMATTER
36
+ - PYTHON_BANDIT
37
+ - PYTHON_BLACK # in Super-Linter
38
+ - PYTHON_FLAKE8 # in Super-Linter
39
+ - PYTHON_ISORT # in Super-Linter
40
+ - PYTHON_MYPY
41
+ - PYTHON_PYLINT # in Super-Linter
42
+ - PYTHON_PYRIGHT
43
+ - R_LINTR # in Super-Linter
44
+ # - RAKU_RAKU # in Super-Linter
45
+ # - RUBY_RUBOCOP # in Super-Linter
46
+ - RUST_CLIPPY # in Super-Linter
47
+ # - SALESFORCE_SFDX_SCANNER_APEX
48
+ # - SALESFORCE_SFDX_SCANNER_AURA
49
+ # - SALESFORCE_SFDX_SCANNER_LWC
50
+ - SCALA_SCALAFIX
51
+ - SQL_SQL_LINT # in Super-Linter
52
+ - SQL_SQLFLUFF # in Super-Linter
53
+ - SQL_TSQLLINT
54
+ - SWIFT_SWIFTLINT
55
+ - TSX_ESLINT
56
+ - TYPESCRIPT_ES # in Super-Linter
57
+ # - TYPESCRIPT_PRETTIER
58
+ - TYPESCRIPT_STANDARD # in Super-Linter
59
+ # - VBDOTNET_DOTNET_FORMAT
60
+
61
+ ### Formats
62
+ # - CSS_SCSS_LINT # Deprecated in favour of stylelint
63
+ - CSS_STYLELINT # in Super-Linter
64
+ - ENV_DOTENV_LINTER # in Super-Linter
65
+ # - GRAPHQL_GRAPHQL_SCHEMA_LINTER
66
+ # - HTML_DJLINT # Refuses to see config file
67
+ - HTML_HTMLHINT # in Super-Linter
68
+ - JSON_ESLINT_PLUGIN_JSONC # in Super-Linter
69
+ - JSON_JSONLINT
70
+ - JSON_NPM_PACKAGE_JSON_LINT
71
+ # - JSON_PRETTIER
72
+ - JSON_V8R
73
+ # - LATEX_CHKTEX # in Super-Linter
74
+ - MARKDOWN_MARKDOWNLINT # in Super-Linter
75
+ - MARKDOWN_MARKDOWN_LINK_CHECK
76
+ - MARKDOWN_MARKDOWN_TABLE_FORMATTER
77
+ - MARKDOWN_REMARK_LINT
78
+ # - PROTOBUF_PROTOLINT # in Super-Linter
79
+ # - RST_RSTCHECK
80
+ # - RST_RSTFMT
81
+ # - RST_RST_LINT
82
+ - XML_XMLLINT # in Super-Linter
83
+ # - YAML_PRETTIER
84
+ - YAML_V8R
85
+ - YAML_YAMLLINT # in Super-Linter
86
+
87
+ ### Tooling
88
+ - ACTION_ACTIONLINT # in Super-Linter
89
+ - ANSIBLE_ANSIBLE_LINT # in Super-Linter
90
+ - ARM_ARM_TTK # in Super-Linter
91
+ # - BICEP_BICEP_LINTER
92
+ - CLOUDFORMATION_CFN_LINT # in Super-Linter
93
+ - DOCKERFILE_HADOLINT # in Super-Linter
94
+ - EDITORCONFIG_EDITORCONFIG_CHECKER # in Super-Linter
95
+ # - GHERKIN_GHERKIN_LINT # in Super-Linter
96
+ - KUBERNETES_KUBECONFORM
97
+ - KUBERNETES_KUBEVAL # in Super-Linter
98
+ - OPENAPI_SPECTRAL # in Super-Linter
99
+ - PUPPET_PUPPET_LINT
100
+ # - SNAKEMAKE_LINT # in Super-Linter
101
+ # - SNAKEMAKE_SNAKEFMT # in Super-Linter
102
+ # - TEKTON_TEKTON_LINT # in Super-Linter
103
+ - TERRAFORM_CHECKOV
104
+ - TERRAFORM_KICS
105
+ - TERRAFORM_TERRAFORM_FMT # in Super-Linter
106
+ - TERRAFORM_TERRAGRUNT # in Super-Linter
107
+ - TERRAFORM_TERRASCAN # in Super-Linter
108
+ - TERRAFORM_TFLINT # in Super-Linter
109
+
110
+ ### Code quality checkers
111
+ - COPYPASTE_JSCPD # in Super-Linter
112
+ - REPOSITORY_CHECKOV
113
+ - REPOSITORY_DEVSKIM
114
+ - REPOSITORY_DUSTILOCK
115
+ - REPOSITORY_GITLEAKS # in Super-Linter
116
+ - REPOSITORY_GIT_DIFF
117
+ - REPOSITORY_GOODCHECK
118
+ - REPOSITORY_SECRETLINT
119
+ - REPOSITORY_SEMGREP
120
+ - REPOSITORY_SYFT
121
+ - REPOSITORY_TRIVY
122
+ # - SPELL_CSPELL
123
+ - SPELL_MISSPELL
124
+ - SPELL_PROSELINT
125
+
126
+ SHOW_ELAPSED_TIME: false
127
+ FILEIO_REPORTER: false
128
+ FAIL_IF_MISSING_LINTER_IN_FLAVOR: true
129
+ # DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect 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,12 @@
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
+ ### Added
11
+
12
+ - Added alex inclusive language testing
@@ -0,0 +1,133 @@
1
+ <!--alex disable sex sexual-->
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, caste, color, religion, or sexual
11
+ identity and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not only for us as individuals, but for the overall
27
+ community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or advances of
32
+ any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email address,
36
+ without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ <report.complaints@healthdatainsight.org.uk>.
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series of
87
+ actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or permanent
94
+ ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within the
114
+ community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.1, available at
120
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127
+ [https://www.contributor-covenant.org/translations][translations].
128
+
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Health Data Insight
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,55 @@
1
+ # WayOfWorking::InclusiveLanguage::Alex
2
+
3
+ <!-- HDI Way of Working: Badge Holder Start -->
4
+ [![HDI Way of Working](https://img.shields.io/badge/HDI-Way%20of%20Working-8169e3?labelColor=000)](https://healthdatainsight.github.io/way_of_working/)
5
+ <!-- HDI Way of Working: Badge Holder End -->
6
+
7
+ 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.
8
+
9
+ 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.
10
+
11
+ This is a plugin for the [Way of Working](https://github.com/HealthDataInsight/way_of_working) framework. It uses [alex](https://alexjs.com) for automated testing of inclusive language, both at the command line and as a GitHub workflow.
12
+
13
+ ## Installation
14
+
15
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_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.
16
+
17
+ Install the gem and add to the application's Gemfile by executing:
18
+
19
+ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
20
+
21
+ If bundler is not being used to manage dependencies, install the gem by executing:
22
+
23
+ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
24
+
25
+ ## Usage
26
+
27
+ To add [alex](https://alexjs.com) to your project, run the following at the command line:
28
+
29
+ ```bash
30
+ way_of_working init inclusive_language
31
+ ```
32
+
33
+ to run alex in your project, run:
34
+
35
+ ```bash
36
+ way_of_working exec inclusive_language
37
+ ```
38
+
39
+ ## Development
40
+
41
+ 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.
42
+
43
+ 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).
44
+
45
+ ## Contributing
46
+
47
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/HealthDataInsight/way_of_working-inclusive_language-alex>. 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-inclusive_language-alex/blob/main/CODE_OF_CONDUCT.md).
48
+
49
+ ## License
50
+
51
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
52
+
53
+ ## Code of Conduct
54
+
55
+ Everyone interacting in the WayOfWorking::InclusiveLanguage::Alex 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-inclusive_language-alex/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,138 @@
1
+ ---
2
+ file safety:
3
+ ".alexrc":
4
+ comments:
5
+ reviewed_by: timgentry
6
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
7
+ ".github/linters/.markdown-link-check.json":
8
+ comments:
9
+ reviewed_by: timgentry
10
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
11
+ ".github/linters/rubocop_defaults.yml":
12
+ comments:
13
+ reviewed_by: timgentry
14
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
15
+ ".github/workflows/inclusive-language.yml":
16
+ comments:
17
+ reviewed_by: timgentry
18
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
19
+ ".github/workflows/main.yml":
20
+ comments:
21
+ reviewed_by: timgentry
22
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
23
+ ".github/workflows/mega-linter.yml":
24
+ comments:
25
+ reviewed_by: timgentry
26
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
27
+ ".gitignore":
28
+ comments:
29
+ reviewed_by: timgentry
30
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
31
+ ".mega-linter.yml":
32
+ comments:
33
+ reviewed_by: timgentry
34
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
35
+ ".rubocop":
36
+ comments:
37
+ reviewed_by: timgentry
38
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
39
+ CHANGELOG.md:
40
+ comments:
41
+ reviewed_by: timgentry
42
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
43
+ CODE_OF_CONDUCT.md:
44
+ comments:
45
+ reviewed_by: timgentry
46
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
47
+ Gemfile:
48
+ comments:
49
+ reviewed_by: timgentry
50
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
51
+ Gemfile.lock:
52
+ comments:
53
+ reviewed_by: timgentry
54
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
55
+ LICENSE.txt:
56
+ comments:
57
+ reviewed_by: timgentry
58
+ safe_revision: 60dabfa968761af6f34984036e86dbcceb8dcfd0
59
+ README.md:
60
+ comments:
61
+ reviewed_by: timgentry
62
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
63
+ Rakefile:
64
+ comments:
65
+ reviewed_by: shilpigoeldev
66
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
67
+ bin/console:
68
+ comments:
69
+ reviewed_by: timgentry
70
+ safe_revision: 60dabfa968761af6f34984036e86dbcceb8dcfd0
71
+ bin/setup:
72
+ comments:
73
+ reviewed_by: timgentry
74
+ safe_revision: 60dabfa968761af6f34984036e86dbcceb8dcfd0
75
+ lib/way_of_working/inclusive_language/alex.rb:
76
+ comments:
77
+ reviewed_by: shilpigoeldev
78
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
79
+ lib/way_of_working/inclusive_language/alex/generators/exec.rb:
80
+ comments:
81
+ reviewed_by: shilpigoeldev
82
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
83
+ lib/way_of_working/inclusive_language/alex/generators/init.rb:
84
+ comments:
85
+ reviewed_by: timgentry
86
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
87
+ lib/way_of_working/inclusive_language/alex/github_audit_rule.rb:
88
+ comments:
89
+ reviewed_by: shilpigoeldev
90
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
91
+ lib/way_of_working/inclusive_language/alex/paths.rb:
92
+ comments:
93
+ reviewed_by: shilpigoeldev
94
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
95
+ lib/way_of_working/inclusive_language/alex/plugin.rb:
96
+ comments:
97
+ reviewed_by: timgentry
98
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
99
+ lib/way_of_working/inclusive_language/alex/templates/.alexignore:
100
+ comments:
101
+ reviewed_by: timgentry
102
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
103
+ lib/way_of_working/inclusive_language/alex/templates/.alexrc:
104
+ comments:
105
+ reviewed_by: timgentry
106
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
107
+ lib/way_of_working/inclusive_language/alex/templates/.github/workflows/inclusive-language.yml:
108
+ comments:
109
+ reviewed_by: timgentry
110
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
111
+ lib/way_of_working/inclusive_language/alex/templates/docs/way_of_working/inclusive-language.md:
112
+ comments:
113
+ reviewed_by: timgentry
114
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
115
+ lib/way_of_working/inclusive_language/alex/version.rb:
116
+ comments:
117
+ reviewed_by: shilpigoeldev
118
+ safe_revision: 60dabfa968761af6f34984036e86dbcceb8dcfd0
119
+ test/test_helper.rb:
120
+ comments:
121
+ reviewed_by: shilpigoeldev
122
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
123
+ test/way_of_working/inclusive_language/alex_test.rb:
124
+ comments:
125
+ reviewed_by: shilpigoeldev
126
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
127
+ test/way_of_working/inclusive_language/generators/exec_test.rb:
128
+ comments:
129
+ reviewed_by: shilpigoeldev
130
+ safe_revision: cbe4ccee99e97402a6b17a3453d80fde37311328
131
+ test/way_of_working/inclusive_language/generators/init_test.rb:
132
+ comments:
133
+ reviewed_by: timgentry
134
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
135
+ way_of_working-inclusive_language-alex.gemspec:
136
+ comments:
137
+ reviewed_by: timgentry
138
+ safe_revision: 321bc80b15da3c679252c5a507115396d9fcbd25
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+ require 'rainbow'
5
+
6
+ module WayOfWorking
7
+ module InclusiveLanguage
8
+ module Alex
9
+ module Generators
10
+ # This generator runs the inclusive language tests
11
+ class Exec < Thor::Group
12
+ argument :path, type: :string, required: false, desc: 'Optional path of the file to test'
13
+
14
+ desc 'This runs the inclusive language tests on this project'
15
+
16
+ def run_first
17
+ @start_time = Time.now
18
+
19
+ say(Rainbow("Limiting tests to #{path}\n").yellow) if path
20
+ end
21
+
22
+ def prep_and_run_alex
23
+ command = ['npx', 'alex', '--why']
24
+ # Configure alex to only test a specific file or folder, if defined
25
+ command << path if path
26
+
27
+ say(Rainbow("\nRunning alex...").yellow)
28
+
29
+ @alex_ok = run_alex(command)
30
+ end
31
+
32
+ def run_last
33
+ say(Rainbow("\nTotal time taken: #{(Time.now - @start_time).to_i} seconds").yellow)
34
+
35
+ if @alex_ok
36
+ say(Rainbow("\nInclusive language tests succeeded!").green)
37
+ else
38
+ abort(Rainbow("\nInclusive language tests failed!").red)
39
+ end
40
+ end
41
+
42
+ private
43
+
44
+ def run_alex(arguments)
45
+ system(*arguments)
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+
5
+ module WayOfWorking
6
+ module InclusiveLanguage
7
+ module Alex
8
+ module Generators
9
+ # This generator adds the alexrc file
10
+ class Init < Thor::Group
11
+ include Thor::Actions
12
+
13
+ source_root ::WayOfWorking::InclusiveLanguage::Alex.source_root
14
+
15
+ def copy_inclusive_language_github_workflow_action
16
+ copy_file '.github/workflows/inclusive-language.yml'
17
+ end
18
+
19
+ def copy_alexignore_file
20
+ copy_file '.alexignore'
21
+ end
22
+
23
+ def copy_alexrc_file
24
+ copy_file '.alexrc'
25
+ end
26
+
27
+ def copy_way_of_working_documentation
28
+ copy_file 'docs/way_of_working/inclusive-language.md'
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'way_of_working/github_audit/rules/base'
4
+
5
+ module WayOfWorking
6
+ module InclusiveLanguage
7
+ # The namespace for plugin
8
+ module Alex
9
+ # This rule checks for the Inclusive Language workflow action and README badge.
10
+ class GithubAuditRule < ::WayOfWorking::Audit::Github::Rules::Base
11
+ def valid?
12
+ response = @client.workflows(@repo_name)
13
+
14
+ unless response.workflows.map(&:name).include?('Inclusive Language')
15
+ @errors << 'No Inclusive Language GitHub Action'
16
+ end
17
+
18
+ @errors << 'Default branch is named "master"' if @repo.default_branch == 'master'
19
+
20
+ @errors << 'No Inclusive Language README Badge' unless inclusive_language_badge?
21
+
22
+ @errors.empty? ? :passed : :failed
23
+ end
24
+
25
+ private
26
+
27
+ def inclusive_language_badge?
28
+ readme_content.include?("[![Inclusive Language](https://github.com/#{@repo_name}/actions/workflows/inclusive-language.yml/badge.svg)]")
29
+ end
30
+ end
31
+
32
+ ::WayOfWorking::Audit::Github::Rules::Registry.register(GithubActionAndBadge,
33
+ 'Inclusive Language GitHub Action and README badge')
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pathname'
4
+
5
+ module WayOfWorking
6
+ module InclusiveLanguage
7
+ # Mixin that provides a couple of pathname convenience methods
8
+ module Alex
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', 'inclusive_language', 'alex', 'templates')
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1 @@
1
+ require 'way_of_working/inclusive_language/alex'
@@ -0,0 +1,2 @@
1
+ /CODE_OF_CONDUCT.md
2
+ /docs/way_of_working/code-of-conduct.md
@@ -0,0 +1,3 @@
1
+ {
2
+ "profanitySureness": 1
3
+ }
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: "Inclusive Language"
3
+ on: push # yamllint disable-line rule:truthy
4
+
5
+ permissions: read-all
6
+
7
+ jobs:
8
+ test_inclusivity:
9
+ name: Inclusive Language Tests
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-node@v4
14
+ with:
15
+ node-version: 20
16
+ - name: Run alex
17
+ run: npx alex --why
@@ -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,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WayOfWorking
4
+ module InclusiveLanguage
5
+ module Alex
6
+ VERSION = '1.0.0'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'way_of_working'
4
+ require_relative 'alex/paths'
5
+ require 'zeitwerk'
6
+
7
+ # If way_of_working-audit-github is used we can add a rule
8
+ github_audit_used =
9
+ begin
10
+ require 'way_of_working/audit/github/rules/registry'
11
+ rescue LoadError
12
+ false
13
+ end
14
+ require_relative 'alex/github_audit_rule' if github_audit_used
15
+
16
+ loader = Zeitwerk::Loader.for_gem_extension(WayOfWorking::InclusiveLanguage)
17
+ loader.ignore("#{__dir__}/alex/plugin.rb")
18
+ loader.setup
19
+
20
+ module WayOfWorking
21
+ module InclusiveLanguage
22
+ module Alex
23
+ class Error < StandardError; end
24
+ end
25
+ end
26
+
27
+ module SubCommands
28
+ # This reopens the "way_of_working exec" (i.e. run) sub command
29
+ class Exec
30
+ register(InclusiveLanguage::Alex::Generators::Exec, 'inclusive_language', 'inclusive_language',
31
+ <<~LONGDESC)
32
+ Description:
33
+ This runs inclusive language tests on this project
34
+
35
+ Example:
36
+ way_of_working exec inclusive_language
37
+ LONGDESC
38
+ end
39
+
40
+ # This reopens the "way_of_working init" sub command
41
+ class Init
42
+ register(InclusiveLanguage::Alex::Generators::Init, 'inclusive_language', 'inclusive_language',
43
+ <<~LONGDESC)
44
+ Description:
45
+ Installs alex config file into the project
46
+
47
+ Example:
48
+ way_of_working init inclusive_language
49
+
50
+ This will create:
51
+ .alexrc
52
+ LONGDESC
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/way_of_working/inclusive_language/alex/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'way_of_working-inclusive_language-alex'
7
+ spec.version = WayOfWorking::InclusiveLanguage::Alex::VERSION
8
+ spec.authors = ['Tim Gentry']
9
+ spec.email = ['52189+timgentry@users.noreply.github.com']
10
+
11
+ spec.summary = 'Way of Working plugin for Inclusive Language using Alex'
12
+ spec.homepage = 'https://github.com/HealthDataInsight/way_of_working-inclusive_language-alex'
13
+ spec.license = 'MIT'
14
+ spec.required_ruby_version = '>= 3.1.0'
15
+
16
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
17
+ spec.metadata['rubygems_mfa_required'] = 'true'
18
+
19
+ spec.metadata['homepage_uri'] = spec.homepage
20
+ spec.metadata['source_code_uri'] = 'https://github.com/HealthDataInsight/way_of_working-inclusive_language-alex'
21
+ spec.metadata['changelog_uri'] = 'https://github.com/HealthDataInsight/way_of_working-inclusive_language-alex/blob/main/CHANGELOG.md'
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(__dir__) do
26
+ `git ls-files -z`.split("\x0").reject do |f|
27
+ (File.expand_path(f) == __FILE__) ||
28
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
29
+ end
30
+ end
31
+ spec.bindir = 'exe'
32
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ['lib']
34
+
35
+ # Uncomment to register a new dependency of your gem
36
+ # spec.add_dependency "example-gem", "~> 1.0"
37
+ spec.add_dependency 'way_of_working', '~> 2.0'
38
+
39
+ # For more information and examples about making a new gem, check out our
40
+ # guide at: https://bundler.io/guides/creating_gem.html
41
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: way_of_working-inclusive_language-alex
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: 2024-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
+ description:
28
+ email:
29
+ - 52189+timgentry@users.noreply.github.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".alexrc"
35
+ - ".mega-linter.yml"
36
+ - ".rubocop"
37
+ - CHANGELOG.md
38
+ - CODE_OF_CONDUCT.md
39
+ - LICENSE.txt
40
+ - README.md
41
+ - Rakefile
42
+ - code_safety.yml
43
+ - lib/way_of_working/inclusive_language/alex.rb
44
+ - lib/way_of_working/inclusive_language/alex/generators/exec.rb
45
+ - lib/way_of_working/inclusive_language/alex/generators/init.rb
46
+ - lib/way_of_working/inclusive_language/alex/github_audit_rule.rb
47
+ - lib/way_of_working/inclusive_language/alex/paths.rb
48
+ - lib/way_of_working/inclusive_language/alex/plugin.rb
49
+ - lib/way_of_working/inclusive_language/alex/templates/.alexignore
50
+ - lib/way_of_working/inclusive_language/alex/templates/.alexrc
51
+ - lib/way_of_working/inclusive_language/alex/templates/.github/workflows/inclusive-language.yml
52
+ - lib/way_of_working/inclusive_language/alex/templates/docs/way_of_working/inclusive-language.md
53
+ - lib/way_of_working/inclusive_language/alex/version.rb
54
+ - way_of_working-inclusive_language-alex.gemspec
55
+ homepage: https://github.com/HealthDataInsight/way_of_working-inclusive_language-alex
56
+ licenses:
57
+ - MIT
58
+ metadata:
59
+ allowed_push_host: https://rubygems.org
60
+ rubygems_mfa_required: 'true'
61
+ homepage_uri: https://github.com/HealthDataInsight/way_of_working-inclusive_language-alex
62
+ source_code_uri: https://github.com/HealthDataInsight/way_of_working-inclusive_language-alex
63
+ changelog_uri: https://github.com/HealthDataInsight/way_of_working-inclusive_language-alex/blob/main/CHANGELOG.md
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 3.1.0
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubygems_version: 3.5.16
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: Way of Working plugin for Inclusive Language using Alex
83
+ test_files: []