rubocop-inclusivity 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2b6237d1e9d200e8c88398b425785f2b71e01d2cf7ff8853c208efd83a23449f
4
+ data.tar.gz: 29777d338a59293c206a6d3233a829c375a344cae93d554c06aa95296ca91e21
5
+ SHA512:
6
+ metadata.gz: 4ab213c6f39cac2db6df37d991fccbb6121f12d71293c8970e5b5fcadf44a5a8c8a7510a62a9a57527a419702796c31d27816625b007037def98641edb81e18a
7
+ data.tar.gz: 3a46b067de2c5bbc3f968c04ff22f511f77d3e8087a3a167ef739b4193e72dd9fb6a44bdebdddc03e338d7874aadd97fa39b8aeffcfc3caeed6969ae19f2dab5
@@ -0,0 +1,19 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ name: RSpec
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: actions/setup-ruby@v1
15
+ - name: Run RSpec
16
+ run: |
17
+ gem install bundler
18
+ bundle install --jobs 4 --retry 3
19
+ bundle exec rspec
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,19 @@
1
+ inherit_mode:
2
+ merge:
3
+ - Exclude
4
+
5
+ require:
6
+ - rubocop-performance
7
+ - standard/cop/semantic_blocks
8
+ - rubocop-inclusivity
9
+
10
+ inherit_gem:
11
+ standard:
12
+ - config/base.yml
13
+
14
+ Inclusivity:
15
+ Enabled: true
16
+
17
+ Naming/FileName:
18
+ Exclude:
19
+ - lib/rubocop-inclusivity.rb
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.7.0
6
+ before_install: gem install bundler -v 2.1.2
@@ -0,0 +1,9 @@
1
+ {
2
+ "packageFiles": [],
3
+ "bumpFiles": [
4
+ {
5
+ "filename": "VERSION",
6
+ "type": "plain-text"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ## 1.0.0 (2020-06-19)
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at aergonaut@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rubocop-inclusivity.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec"
8
+ gem "byebug"
9
+ gem "standard"
10
+ gem "rubocop-performance", "~> 1.5.2"
@@ -0,0 +1,100 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rubocop-inclusivity (1.0.0)
5
+ rubocop
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activesupport (6.0.2.2)
11
+ concurrent-ruby (~> 1.0, >= 1.0.2)
12
+ i18n (>= 0.7, < 2)
13
+ minitest (~> 5.1)
14
+ tzinfo (~> 1.1)
15
+ zeitwerk (~> 2.2)
16
+ addressable (2.7.0)
17
+ public_suffix (>= 2.0.2, < 5.0)
18
+ ast (2.4.0)
19
+ byebug (9.1.0)
20
+ concurrent-ruby (1.1.6)
21
+ diff-lcs (1.3)
22
+ faraday (0.17.3)
23
+ multipart-post (>= 1.2, < 3)
24
+ faraday-http-cache (2.0.0)
25
+ faraday (~> 0.8)
26
+ github_changelog_generator (1.15.0)
27
+ activesupport
28
+ faraday-http-cache
29
+ multi_json
30
+ octokit (~> 4.6)
31
+ rainbow (>= 2.2.1)
32
+ rake (>= 10.0)
33
+ retriable (~> 3.0)
34
+ i18n (1.8.2)
35
+ concurrent-ruby (~> 1.0)
36
+ jaro_winkler (1.5.4)
37
+ minitest (5.14.0)
38
+ multi_json (1.14.1)
39
+ multipart-post (2.1.1)
40
+ octokit (4.18.0)
41
+ faraday (>= 0.9)
42
+ sawyer (~> 0.8.0, >= 0.5.3)
43
+ parallel (1.19.1)
44
+ parser (2.7.1.0)
45
+ ast (~> 2.4.0)
46
+ public_suffix (4.0.3)
47
+ rainbow (3.0.0)
48
+ rake (12.3.3)
49
+ retriable (3.1.2)
50
+ rexml (3.2.4)
51
+ rspec (3.9.0)
52
+ rspec-core (~> 3.9.0)
53
+ rspec-expectations (~> 3.9.0)
54
+ rspec-mocks (~> 3.9.0)
55
+ rspec-core (3.9.1)
56
+ rspec-support (~> 3.9.1)
57
+ rspec-expectations (3.9.1)
58
+ diff-lcs (>= 1.2.0, < 2.0)
59
+ rspec-support (~> 3.9.0)
60
+ rspec-mocks (3.9.1)
61
+ diff-lcs (>= 1.2.0, < 2.0)
62
+ rspec-support (~> 3.9.0)
63
+ rspec-support (3.9.2)
64
+ rubocop (0.80.1)
65
+ jaro_winkler (~> 1.5.1)
66
+ parallel (~> 1.10)
67
+ parser (>= 2.7.0.1)
68
+ rainbow (>= 2.2.2, < 4.0)
69
+ rexml
70
+ ruby-progressbar (~> 1.7)
71
+ unicode-display_width (>= 1.4.0, < 1.7)
72
+ rubocop-performance (1.5.2)
73
+ rubocop (>= 0.71.0)
74
+ ruby-progressbar (1.10.1)
75
+ sawyer (0.8.2)
76
+ addressable (>= 2.3.5)
77
+ faraday (> 0.8, < 2.0)
78
+ standard (0.2.3)
79
+ rubocop (~> 0.80.1)
80
+ rubocop-performance (~> 1.5.2)
81
+ thread_safe (0.3.6)
82
+ tzinfo (1.2.7)
83
+ thread_safe (~> 0.1)
84
+ unicode-display_width (1.6.1)
85
+ zeitwerk (2.3.0)
86
+
87
+ PLATFORMS
88
+ ruby
89
+
90
+ DEPENDENCIES
91
+ byebug
92
+ github_changelog_generator
93
+ rake (~> 12.0)
94
+ rspec
95
+ rubocop-inclusivity!
96
+ rubocop-performance (~> 1.5.2)
97
+ standard
98
+
99
+ BUNDLED WITH
100
+ 2.1.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Chris Fung
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.
@@ -0,0 +1,60 @@
1
+ # `rubocop-inclusivity`
2
+
3
+ **rubocop-inclusivity** is a RuboCop extension to promote inclusive language in
4
+ Ruby projects.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'rubocop-inclusivity', require: false
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle install
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install rubocop-inclusivity
21
+
22
+ ## The Cops
23
+
24
+ All cops are located under [`lib/rubocop/cop/inclusivity`](lib/rubocop/cop/inclusivity),
25
+ and contains examples/documentation.
26
+
27
+ In your `.rubocop.yml`, you may treat the Inclusivity cops just like any other
28
+ cop. For example:
29
+
30
+ ```yaml
31
+ Inclusivity/Race:
32
+ Exclude:
33
+ - lib/example.rb
34
+ ```
35
+
36
+ ## Development
37
+
38
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
39
+ `rake spec` to run the tests. You can also run `bin/console` for an interactive
40
+ prompt that will allow you to experiment.
41
+
42
+ To install this gem onto your local machine, run `bundle exec rake install`. To
43
+ release a new version, update the version number in `version.rb`, and then run
44
+ `bundle exec rake release`, which will create a git tag for the version, push
45
+ git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
46
+
47
+ ## Contributing
48
+
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/aergonaut/rubocop-inclusivity. This project is intended to be a safe, welcoming space for collaboration, and
50
+ contributors are expected to adhere to the [code of conduct](https://github.com/aergonaut/rubocop-inclusivity/blob/master/CODE_OF_CONDUCT.md).
51
+
52
+ ## License
53
+
54
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
55
+
56
+ ## Code of Conduct
57
+
58
+ Everyone interacting in the Rubocop::Inclusivity project's codebases, issue
59
+ trackers, chat rooms and mailing lists is expected to follow the
60
+ [code of conduct](https://github.com/[USERNAME]/rubocop-inclusivity/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,30 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ task default: :spec
5
+
6
+ RSpec::Core::RakeTask.new(:spec) do |spec|
7
+ spec.pattern = FileList["spec/**/*_spec.rb"]
8
+ end
9
+
10
+ desc "Generate a new cop with a template"
11
+ task :new_cop, [:cop] do |_task, args|
12
+ require "rubocop"
13
+
14
+ cop_name = args.fetch(:cop) {
15
+ warn "usage: bundle exec rake new_cop[Department/Name]"
16
+ exit!
17
+ }
18
+
19
+ github_user = `git config github.user`.chop
20
+ github_user = "your_id" if github_user.empty?
21
+
22
+ generator = RuboCop::Cop::Generator.new(cop_name, github_user)
23
+
24
+ generator.write_source
25
+ generator.write_spec
26
+ generator.inject_require(root_file_path: "lib/rubocop/cop/inclusivity_cops.rb")
27
+ generator.inject_config(config_file_path: "config/default.yml")
28
+
29
+ puts generator.todo
30
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rubocop/inclusivity"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,19 @@
1
+ Inclusivity/Race:
2
+ Description: >-
3
+ Suggests replacing racially-charged or insensitive language with more
4
+ accurate and inclusive words.
5
+ Reference: https://github.com/rails/rails/issues/33677
6
+ Enabled: true
7
+ Offenses:
8
+ whitelist:
9
+ - allowlist
10
+ - passlist
11
+ - permitlist
12
+ blacklist:
13
+ - banlist
14
+ - blocklist
15
+ - denylist
16
+ master:
17
+ - primary
18
+ slave:
19
+ - secondary
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubocop"
4
+
5
+ require_relative "rubocop/inclusivity"
6
+ require_relative "rubocop/inclusivity/version"
7
+ require_relative "rubocop/inclusivity/inject"
8
+
9
+ RuboCop::Inclusivity::Inject.defaults!
10
+
11
+ require_relative "rubocop/cop/inclusivity_cops"