linter 0.1.7 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -3
- data/data/gender_association_wordlist.yml +116 -111
- data/data/mindset_wordlist.yml +31 -0
- data/data/misused_wordlist.yml +30 -0
- data/data/pronoun_association_wordlist.yml +11 -10
- data/data/recommendations.yml +53 -0
- data/data/sources.yml +7 -0
- data/lib/linter.rb +14 -2
- data/lib/linter/base_association.rb +17 -11
- data/lib/linter/gender_association.rb +4 -0
- data/lib/linter/mindset_association.rb +32 -0
- data/lib/linter/version.rb +1 -1
- metadata +23 -18
- data/.gitignore +0 -11
- data/.gitlab-ci.yml +0 -18
- data/.rspec +0 -3
- data/.rubocop.yml +0 -70
- data/.rubocop_todo.yml +0 -60
- data/.ruby-version +0 -1
- data/.travis.yml +0 -7
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -11
- data/Gemfile.lock +0 -69
- data/Rakefile +0 -8
- data/bin/console +0 -16
- data/bin/setup +0 -8
- data/linter.gemspec +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f6c8116c4b1a24d73d27bba7a73c1a0c181d7c7cc33d1ae752b688de68cf9fa
|
4
|
+
data.tar.gz: e2824833060c739d59ae5634e6a61752bc30fa957b186fcfe818dea0f292f995
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aceb6c6039b820decb927586cdce44206aff07fc280de67cf9d206a914e2bbc2120bc7166784a46b4d5a8b42d056063e3385f12f4f38c7b7d10dff94196f9c78
|
7
|
+
data.tar.gz: 2ef6e8ecbe3a073501b081f5e8ef43053b64b3af1e086172b95aa09f29fd2ac2f6ab3c6aea6eb380768edaa7812fd5f51173612982cf57dd1f90d97fbbde366a
|
data/README.md
CHANGED
@@ -23,18 +23,46 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
## Usage
|
25
25
|
|
26
|
+
If you want to perform all of the inclusiveness checks we currently offer, you can run:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
text = 'your text here'
|
30
|
+
response = Linter.analyze(text)
|
31
|
+
```
|
32
|
+
|
33
|
+
If you want to include the checks specifically for job ads as well, run it like this:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
text = 'your text here'
|
37
|
+
response = Linter.analyze(text, job_ad: true)
|
38
|
+
```
|
39
|
+
|
40
|
+
You can also use the checks individually:
|
41
|
+
|
26
42
|
```ruby
|
27
43
|
text = 'Collaborate closely with the manager. Analytics all the way.'
|
28
44
|
Linter::GenderAssociation.analyze(text)
|
29
45
|
# #<OpenStruct feminine_coded_word_counts={"collaborate" => 1}, masculine_coded_word_counts={"analytics" => 1}, trend="neutral">
|
46
|
+
|
30
47
|
text = 'He was working at the bar.'
|
31
48
|
Linter::PronounAssociation.analyze(text)
|
49
|
+
#<OpenStruct trend="masculine-coded", feminine_coded_word_counts={}, masculine_coded_word_counts={"he"=>1}>
|
50
|
+
|
51
|
+
text = 'You are my spirit animal'
|
52
|
+
Linter::MisusedWords.analyze(text)
|
53
|
+
#<OpenStruct misused_words=[{"word"=>"spirit animal", "reason"=>"The problem is that spirit animals are an important part of the belief\nsystem of some cultures and refer to a spirit that “helps guide or protect\na person on a journey and whose characteristics that person shares or\nembodies.” Referring to something as your spirit animal is cultural\nappropriation. Avoid using it.\n", "replace_with"=>["kindred spirit", "raison d'etre"]}], trend="">
|
32
54
|
```
|
33
55
|
|
34
|
-
|
56
|
+
You'll notice that the `association` checks do a comparison of the whole text and will determine a _trend_ for your text. When your text uses a lot of
|
57
|
+
masculine-coded language, the text will be marked as such. The regular checks (like `MisusedWords`) will return all the misused words, a reason why and if possible, we provide some suggestions to replace the word.
|
58
|
+
|
59
|
+
We've also included a `recommendation` where possible. This is to help guide people what to do with the results from the
|
60
|
+
trend.
|
61
|
+
|
62
|
+
## CLI Usage
|
35
63
|
|
36
64
|
```console
|
37
|
-
linter example.md
|
65
|
+
linter path/to_file/example.md
|
38
66
|
#<OpenStruct feminine_coded_word_counts={}, masculine_coded_word_counts={"analytical"=>1}, trend="strongly masculine-coded">
|
39
67
|
#<OpenStruct feminine_coded_word_counts={}, masculine_coded_word_counts={"he"=>1}, trend="masculine-coded">
|
40
68
|
```
|
@@ -47,7 +75,15 @@ To install this gem onto your local machine, run `bundle exec rake install`.
|
|
47
75
|
|
48
76
|
## Contributing
|
49
77
|
|
50
|
-
Bug reports and
|
78
|
+
Bug reports and merge requests are welcome on GitLab at https://gitlab.com/lienvdsteen/linter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
79
|
+
|
80
|
+
We are looking for different types of contributions:
|
81
|
+
- additional checks
|
82
|
+
- adding/editing words to the existing wordlists
|
83
|
+
- support for other languages besides English
|
84
|
+
- ...
|
85
|
+
|
86
|
+
If you add any checks or words, please also add the sources used to the `sources.yml` file.
|
51
87
|
|
52
88
|
## License
|
53
89
|
|
@@ -1,112 +1,117 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
1
|
+
words:
|
2
|
+
feminine_coded:
|
3
|
+
- agree
|
4
|
+
- affectionate
|
5
|
+
- child*
|
6
|
+
- cheer
|
7
|
+
- collab
|
8
|
+
- commit
|
9
|
+
- communal
|
10
|
+
- community
|
11
|
+
- compassion
|
12
|
+
- connect
|
13
|
+
- considerate
|
14
|
+
- cooperat
|
15
|
+
- co-operat
|
16
|
+
- depend
|
17
|
+
- emotiona
|
18
|
+
- empath
|
19
|
+
- feel
|
20
|
+
- flatterable
|
21
|
+
- gentle
|
22
|
+
- honest
|
23
|
+
- interpersonal
|
24
|
+
- interdependen
|
25
|
+
- interpersona
|
26
|
+
- inter-personal
|
27
|
+
- inter-dependen
|
28
|
+
- inter-persona
|
29
|
+
- kind
|
30
|
+
- kinship
|
31
|
+
- loyal
|
32
|
+
- modesty
|
33
|
+
- nag
|
34
|
+
- nurtur
|
35
|
+
- pleasant
|
36
|
+
- polite
|
37
|
+
- provide
|
38
|
+
- quiet*
|
39
|
+
- respon
|
40
|
+
- sensitiv
|
41
|
+
- submissive
|
42
|
+
- support
|
43
|
+
- sympath
|
44
|
+
- tender
|
45
|
+
- together
|
46
|
+
- trust
|
47
|
+
- understand
|
48
|
+
- warm
|
49
|
+
- whin
|
50
|
+
- enthusias
|
51
|
+
- inclusive
|
52
|
+
- yield
|
53
|
+
- share
|
54
|
+
- sharin
|
52
55
|
|
53
|
-
masculine_coded:
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
56
|
+
masculine_coded:
|
57
|
+
- active
|
58
|
+
- adventurous
|
59
|
+
- aggress
|
60
|
+
- ambitio
|
61
|
+
- analytics
|
62
|
+
- analy
|
63
|
+
- assert
|
64
|
+
- athlet
|
65
|
+
- autonom
|
66
|
+
- battle
|
67
|
+
- boast
|
68
|
+
- challeng
|
69
|
+
- champion
|
70
|
+
- compet
|
71
|
+
- confident
|
72
|
+
- courag
|
73
|
+
- decid
|
74
|
+
- decision
|
75
|
+
- decisive
|
76
|
+
- defend
|
77
|
+
- determin
|
78
|
+
- direct
|
79
|
+
- domina
|
80
|
+
- dominant
|
81
|
+
- driven
|
82
|
+
- fearless
|
83
|
+
- fight
|
84
|
+
- force
|
85
|
+
- guys
|
86
|
+
- greedy
|
87
|
+
- head-strong
|
88
|
+
- headstrong
|
89
|
+
- hierarch
|
90
|
+
- hostil
|
91
|
+
- impulsive
|
92
|
+
- independen
|
93
|
+
- individual
|
94
|
+
- intellect
|
95
|
+
- lead
|
96
|
+
- logic
|
97
|
+
- manpower
|
98
|
+
- manning
|
99
|
+
- middleman
|
100
|
+
- ninja
|
101
|
+
- objective
|
102
|
+
- opinion
|
103
|
+
- outspoken
|
104
|
+
- persist
|
105
|
+
- principle
|
106
|
+
- reckless
|
107
|
+
- rockstar
|
108
|
+
- self-confiden
|
109
|
+
- self-relian
|
110
|
+
- self-sufficien
|
111
|
+
- selfconfiden
|
112
|
+
- selfrelian
|
113
|
+
- selfsufficien
|
114
|
+
- stubborn
|
115
|
+
- strong
|
116
|
+
- superior
|
117
|
+
- unreasonab
|
@@ -0,0 +1,31 @@
|
|
1
|
+
words:
|
2
|
+
growth_coded:
|
3
|
+
- striving
|
4
|
+
- driven
|
5
|
+
- commit
|
6
|
+
- highly motivated
|
7
|
+
- improvement
|
8
|
+
- learn
|
9
|
+
- strive
|
10
|
+
- serve
|
11
|
+
- grow
|
12
|
+
- persevere
|
13
|
+
- determined
|
14
|
+
|
15
|
+
fixed_coded:
|
16
|
+
- ability
|
17
|
+
- est
|
18
|
+
- brightest
|
19
|
+
- smart
|
20
|
+
- performer
|
21
|
+
- intelligent
|
22
|
+
- rockstar
|
23
|
+
- superhero
|
24
|
+
- genius
|
25
|
+
- expert
|
26
|
+
- strong
|
27
|
+
- take
|
28
|
+
- brilliant
|
29
|
+
- natural
|
30
|
+
- talent
|
31
|
+
- overachieve
|
data/data/misused_wordlist.yml
CHANGED
@@ -132,3 +132,33 @@ problematic:
|
|
132
132
|
replace_with:
|
133
133
|
- If you are using it as a descriptor for a person with an intellectual disability in a context where such a descriptor is necessary, you could replace it with a term that does not have the same derogatory connotation, or the name of the actual disability if relevant.
|
134
134
|
- If you are using it to insult someone (e.g. "You're such a retard") then don't.
|
135
|
+
- word: blacklist
|
136
|
+
reason: |
|
137
|
+
Black is too often used in a negative context (with the opposite being
|
138
|
+
referred to as white). Please consider using alternatives when they convey
|
139
|
+
the same meaning.
|
140
|
+
replace_with:
|
141
|
+
- blocklist
|
142
|
+
- word: whitelist
|
143
|
+
reason: |
|
144
|
+
Black & white are often used in contexts where white is the positive item,
|
145
|
+
and black the negative item. Please consider using alternatives when they
|
146
|
+
convey the same meaning.
|
147
|
+
replace_with:
|
148
|
+
- allowlist
|
149
|
+
- word: master
|
150
|
+
reason: |
|
151
|
+
Master (in context of master/slave) is often used in computer terminology
|
152
|
+
when leader/follower, or primary/replica are as meaningful and don't have
|
153
|
+
a connotation of slavery.
|
154
|
+
replace_with:
|
155
|
+
- leader
|
156
|
+
- primary
|
157
|
+
- word: slave
|
158
|
+
reason: |
|
159
|
+
Master (in context of master/slave) is often used in computer terminology
|
160
|
+
when leader/follower, or primary/replica are as meaningful and don't have
|
161
|
+
a connotation of slavery.
|
162
|
+
replace_with:
|
163
|
+
- follower
|
164
|
+
- replica
|
@@ -0,0 +1,53 @@
|
|
1
|
+
- type: gender
|
2
|
+
trends:
|
3
|
+
- result: neutral
|
4
|
+
recommendation: |
|
5
|
+
Either you aren't using any gender-coded words or you found a good balance between using gender-coded words.
|
6
|
+
There could still be other factors that make this text less inclusive.
|
7
|
+
- result: masculine-coded
|
8
|
+
recommendation: |
|
9
|
+
You're using more masculine-coded words than feminine coded-words. Try to replace the words listed as masculine-coded.
|
10
|
+
This will result in a more balanced and inclusive text. If this happens to be a job ad, note that according to
|
11
|
+
<a href='http://gender-decoder.katmatfield.com/static/documents/Gaucher-Friesen-Kay-JPSP-Gendered-Wording-in-Job-ads.pdf'>this study</a>
|
12
|
+
it risks putting women off and encourage men to apply.
|
13
|
+
- result: strongly masculine-coded
|
14
|
+
recommendation: |
|
15
|
+
You're using more masculine-coded words than feminine coded-words. Try to replace the words listed as masculine-coded.
|
16
|
+
This will result in a more balanced and inclusive text. If this happens to be a job ad, note that according to
|
17
|
+
<a href='http://gender-decoder.katmatfield.com/static/documents/Gaucher-Friesen-Kay-JPSP-Gendered-Wording-in-Job-ads.pdf'>this study</a>
|
18
|
+
it risks putting women off and encourage men to apply.
|
19
|
+
- result: feminine-coded
|
20
|
+
recommendation: |
|
21
|
+
You're using more feminine coded-words than masculine-coded. You could replace some words however, a feminine-coded text only
|
22
|
+
has a slight effect on the inclusiveness of your text. For example, if this is a job ad, it will encourage women to apply
|
23
|
+
but the effect on men is minimal. See <a href='http://gender-decoder.katmatfield.com/static/documents/Gaucher-Friesen-Kay-JPSP-Gendered-Wording-in-Job-ads.pdf'>this study</a>.
|
24
|
+
- result: strongly feminine-coded
|
25
|
+
recommendation: |
|
26
|
+
You're using more feminine coded-words than masculine-coded. You could replace some words however, a feminine-coded text only
|
27
|
+
has a slight effect on the inclusiveness of your text. For example, if this is a job ad, it will encourage women to apply
|
28
|
+
but the effect on men is minimal. See <a href='http://gender-decoder.katmatfield.com/static/documents/Gaucher-Friesen-Kay-JPSP-Gendered-Wording-in-Job-ads.pdf'>this study</a>.
|
29
|
+
- type: mindset
|
30
|
+
trends:
|
31
|
+
- result: neutral
|
32
|
+
recommendation: |
|
33
|
+
Although it is marked as neutral, it might be good to look into changing the text a little bit. Growth mindset terms imply abilities and
|
34
|
+
talents can be developed. Recruiting content that uses growth mindset language can lead to faster hiring times
|
35
|
+
and more hires being made from underrepresented groups.
|
36
|
+
- result: growth-coded
|
37
|
+
recommendation: |
|
38
|
+
Growth mindset terms imply abilities and talents can be developed. Recruiting content that uses growth mindset language can lead to faster hiring times
|
39
|
+
and more hires being made from underrepresented groups. This text is a great start to make sure you're inclusive on a mindset-level.
|
40
|
+
- result: fixed-coded
|
41
|
+
recommendation: |
|
42
|
+
Fixed-mindset implies that talents and traits are innate and static. Recruiting content that uses growth mindset language can lead to faster hiring times
|
43
|
+
and more hires being made from underrepresented groups. We'd recommend you replace some of the words listed as fixed. You can find some more
|
44
|
+
information in <a href='https://medium.com/textio/growth-mindset-language-41d51c91432'>this medium post</a>.
|
45
|
+
- result: strongly growth-coded
|
46
|
+
recommendation: |
|
47
|
+
Growth mindset terms imply abilities and talents can be developed. Recruiting content that uses growth mindset language can lead to faster hiring times
|
48
|
+
and more hires being made from underrepresented groups. This text is a great start to make sure you're inclusive on a mindset-level.
|
49
|
+
- result: strongly fixed-coded
|
50
|
+
recommendation: |
|
51
|
+
Fixed-mindset implies that talents and traits are innate and static. Recruiting content that uses growth mindset language can lead to faster hiring times
|
52
|
+
and more hires being made from underrepresented groups. We'd recommend you replace some of the words listed as fixed. You can find some more
|
53
|
+
information in <a href='https://medium.com/textio/growth-mindset-language-41d51c91432'>this medium post</a>.
|
data/data/sources.yml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# List any source used here. We will make sure this is listed and credit is given.
|
2
|
+
- title: Gender Decoder Tool by Kat Matfield
|
3
|
+
url: http://gender-decoder.katmatfield.com/
|
4
|
+
- title: Evidence That Gendered Wording in Job Advertisements Exists and Sustains Gender Inequality
|
5
|
+
url: http://gender-decoder.katmatfield.com/static/documents/Gaucher-Friesen-Kay-JPSP-Gendered-Wording-in-Job-ads.pdf
|
6
|
+
- title: Want to hire faster? Write about “learning,” not “brilliance”
|
7
|
+
url: https://medium.com/textio/growth-mindset-language-41d51c91432
|
data/lib/linter.rb
CHANGED
@@ -6,6 +6,7 @@ require_relative 'linter/gender_association'
|
|
6
6
|
require_relative 'linter/pronoun_association'
|
7
7
|
require_relative 'linter/cli'
|
8
8
|
require_relative 'linter/misused_words'
|
9
|
+
require_relative 'linter/mindset_association'
|
9
10
|
|
10
11
|
require 'yaml'
|
11
12
|
require 'colorize'
|
@@ -15,8 +16,19 @@ module Linter
|
|
15
16
|
class Error < StandardError; end
|
16
17
|
|
17
18
|
class << self
|
18
|
-
def
|
19
|
-
|
19
|
+
def analyze(text, job_ad: false)
|
20
|
+
response = {
|
21
|
+
gender_association_analysis: Linter::GenderAssociation.analyze(text),
|
22
|
+
pronoun_analysis: Linter::PronounAssociation.analyze(text),
|
23
|
+
misused_words_analysis: Linter::MisusedWords.analyze(text)
|
24
|
+
}
|
25
|
+
response[:mindset_association_analysis] = Linter::MindsetAssociation.analyze(text) if job_ad
|
26
|
+
response
|
27
|
+
end
|
28
|
+
|
29
|
+
def sources
|
30
|
+
file_path = File.join(__dir__, '../data/sources.yml')
|
31
|
+
YAML.load_file(file_path)
|
20
32
|
end
|
21
33
|
end
|
22
34
|
end
|
@@ -3,21 +3,18 @@
|
|
3
3
|
module Linter
|
4
4
|
class BaseAssociation
|
5
5
|
def self.analyze(text)
|
6
|
-
result = OpenStruct.new(
|
7
|
-
feminine_coded_word_counts: {},
|
8
|
-
masculine_coded_word_counts: {},
|
9
|
-
trend: ''
|
10
|
-
)
|
6
|
+
result = OpenStruct.new(trend: '')
|
11
7
|
|
12
|
-
wordlists
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
wordlists.dig('words').each do |key, words|
|
9
|
+
word_count_key = "#{key}_word_counts".to_sym
|
10
|
+
result[word_count_key] = {}
|
11
|
+
words.each do |word|
|
12
|
+
result.send(word_count_key).merge!(word_count(text, word))
|
13
|
+
end
|
18
14
|
end
|
19
15
|
|
20
16
|
result.trend = calculate_trend(result)
|
17
|
+
result.recommendation = add_recommendation(result)
|
21
18
|
result
|
22
19
|
end
|
23
20
|
|
@@ -38,5 +35,14 @@ module Linter
|
|
38
35
|
.transform_values(&:size)
|
39
36
|
.to_h
|
40
37
|
end
|
38
|
+
|
39
|
+
def self.recommendation_file
|
40
|
+
file_path = File.join(__dir__, '../../data/recommendations.yml')
|
41
|
+
@recommendation_file ||= YAML.load_file(file_path)
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.add_recommendation(_result)
|
45
|
+
false
|
46
|
+
end
|
41
47
|
end
|
42
48
|
end
|
@@ -25,5 +25,9 @@ module Linter
|
|
25
25
|
'masculine-coded'
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
def self.add_recommendation(result)
|
30
|
+
recommendation_file.find { |rec| rec['type'] == 'gender' }&.dig('trends')&.find { |trend| trend['result'] == result.trend }&.dig('recommendation')
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Linter
|
4
|
+
class MindsetAssociation < BaseAssociation
|
5
|
+
USE_FOR_JOB_ADS = true
|
6
|
+
FULL_WORD = false
|
7
|
+
|
8
|
+
def self.wordlists
|
9
|
+
file_path = File.join(__dir__, '../../data/mindset_wordlist.yml')
|
10
|
+
@wordlists ||= YAML.load_file(file_path)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.calculate_trend(result)
|
14
|
+
case result.growth_coded_word_counts.values.sum - result.fixed_coded_word_counts.values.sum
|
15
|
+
when 0
|
16
|
+
'neutral'
|
17
|
+
when 1..3
|
18
|
+
'growth-coded'
|
19
|
+
when 3..Float::INFINITY
|
20
|
+
'strongly growth-coded'
|
21
|
+
when -Float::INFINITY..-3
|
22
|
+
'strongly fixed-coded'
|
23
|
+
else
|
24
|
+
'fixed-coded'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.add_recommendation(result)
|
29
|
+
recommendation_file.find { |rec| rec['type'] == 'mindset' }&.dig('trends')&.find { |trend| trend['result'] == result.trend }&.dig('recommendation')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/linter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lien van den steen
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.85'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-packaging
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.1'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.1'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rubocop-rspec
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,37 +125,28 @@ dependencies:
|
|
111
125
|
description:
|
112
126
|
email:
|
113
127
|
- lienvandensteen@gmail.com
|
114
|
-
executables:
|
128
|
+
executables:
|
129
|
+
- linter
|
115
130
|
extensions: []
|
116
131
|
extra_rdoc_files: []
|
117
132
|
files:
|
118
|
-
- ".gitignore"
|
119
|
-
- ".gitlab-ci.yml"
|
120
|
-
- ".rspec"
|
121
|
-
- ".rubocop.yml"
|
122
|
-
- ".rubocop_todo.yml"
|
123
|
-
- ".ruby-version"
|
124
|
-
- ".travis.yml"
|
125
|
-
- CODE_OF_CONDUCT.md
|
126
|
-
- Gemfile
|
127
|
-
- Gemfile.lock
|
128
133
|
- LICENSE.txt
|
129
134
|
- README.md
|
130
|
-
- Rakefile
|
131
|
-
- bin/console
|
132
135
|
- bin/linter
|
133
|
-
- bin/setup
|
134
136
|
- data/gender_association_wordlist.yml
|
137
|
+
- data/mindset_wordlist.yml
|
135
138
|
- data/misused_wordlist.yml
|
136
139
|
- data/pronoun_association_wordlist.yml
|
140
|
+
- data/recommendations.yml
|
141
|
+
- data/sources.yml
|
137
142
|
- lib/linter.rb
|
138
143
|
- lib/linter/base_association.rb
|
139
144
|
- lib/linter/cli.rb
|
140
145
|
- lib/linter/gender_association.rb
|
146
|
+
- lib/linter/mindset_association.rb
|
141
147
|
- lib/linter/misused_words.rb
|
142
148
|
- lib/linter/pronoun_association.rb
|
143
149
|
- lib/linter/version.rb
|
144
|
-
- linter.gemspec
|
145
150
|
homepage: https://gitlab.com/lienvdsteen/linter
|
146
151
|
licenses:
|
147
152
|
- MIT
|
data/.gitignore
DELETED
data/.gitlab-ci.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
rspec:
|
2
|
-
stage: test
|
3
|
-
only:
|
4
|
-
- merge_requests
|
5
|
-
script:
|
6
|
-
- bundle install
|
7
|
-
- bundle exec rspec
|
8
|
-
|
9
|
-
rubocop:
|
10
|
-
stage: test
|
11
|
-
only:
|
12
|
-
- merge_requests
|
13
|
-
script:
|
14
|
-
- bundle install
|
15
|
-
- bundle exec rubocop
|
16
|
-
|
17
|
-
include:
|
18
|
-
template: Dependency-Scanning.gitlab-ci.yml
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
2
|
-
|
3
|
-
require:
|
4
|
-
- rubocop-rspec
|
5
|
-
AllCops:
|
6
|
-
TargetRubyVersion: 2.6
|
7
|
-
# Cop names are displayed in offense messages by default. Change behavior
|
8
|
-
# by overriding DisplayCopNames, or by giving the `--no-display-cop-names`
|
9
|
-
# option.
|
10
|
-
DisplayCopNames: true
|
11
|
-
# Style guide URLs are not displayed in offense messages by default. Change
|
12
|
-
# behavior by overriding DisplayStyleGuide, or by giving the
|
13
|
-
# -S/--display-style-guide option.
|
14
|
-
DisplayStyleGuide: false
|
15
|
-
# Exclude some GitLab files
|
16
|
-
Exclude:
|
17
|
-
- '.gitlab/**/*'
|
18
|
-
|
19
|
-
Style/NumericLiteralPrefix:
|
20
|
-
Enabled: false
|
21
|
-
Metrics/BlockLength:
|
22
|
-
Enabled: false
|
23
|
-
Layout/LineLength:
|
24
|
-
Enabled: false
|
25
|
-
Style/Documentation:
|
26
|
-
Enabled: false
|
27
|
-
RSpec/FilePath:
|
28
|
-
Enabled: false
|
29
|
-
Metrics/AbcSize:
|
30
|
-
Max: 60
|
31
|
-
Metrics/MethodLength:
|
32
|
-
Max: 30
|
33
|
-
RSpec/ExampleLength:
|
34
|
-
Enabled: false
|
35
|
-
RSpec/MultipleExpectations:
|
36
|
-
Max: 2
|
37
|
-
RSpec/NestedGroups:
|
38
|
-
Max: 5
|
39
|
-
Layout/SpaceInsideHashLiteralBraces:
|
40
|
-
Enabled: false
|
41
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
42
|
-
Enabled: true
|
43
|
-
Layout/SpaceAroundMethodCallOperator:
|
44
|
-
Enabled: true
|
45
|
-
Layout/SpaceInsideBlockBraces:
|
46
|
-
Enabled: false
|
47
|
-
Style/SlicingWithRange:
|
48
|
-
Enabled: true
|
49
|
-
Style/ConditionalAssignment:
|
50
|
-
EnforcedStyle: assign_inside_condition
|
51
|
-
Lint/DeprecatedOpenSSLConstant:
|
52
|
-
Enabled: true
|
53
|
-
Lint/MixedRegexpCaptureTypes:
|
54
|
-
Enabled: true
|
55
|
-
Lint/RaiseException:
|
56
|
-
Enabled: true
|
57
|
-
Lint/StructNewOverride:
|
58
|
-
Enabled: true
|
59
|
-
Style/ExponentialNotation:
|
60
|
-
Enabled: true
|
61
|
-
Style/HashEachMethods:
|
62
|
-
Enabled: true
|
63
|
-
Style/HashTransformKeys:
|
64
|
-
Enabled: true
|
65
|
-
Style/HashTransformValues:
|
66
|
-
Enabled: true
|
67
|
-
Style/RedundantRegexpCharacterClass:
|
68
|
-
Enabled: true
|
69
|
-
Style/RedundantRegexpEscape:
|
70
|
-
Enabled: true
|
data/.rubocop_todo.yml
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2020-06-06 22:58:53 +0200 using RuboCop version 0.85.0.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 1
|
10
|
-
# Cop supports --auto-correct.
|
11
|
-
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
|
12
|
-
Layout/ExtraSpacing:
|
13
|
-
Exclude:
|
14
|
-
- 'linter.gemspec'
|
15
|
-
|
16
|
-
# Offense count: 3
|
17
|
-
# Cop supports --auto-correct.
|
18
|
-
Layout/SpaceAfterComma:
|
19
|
-
Exclude:
|
20
|
-
- 'lib/linter/gender_association.rb'
|
21
|
-
- 'lib/linter/misused_words.rb'
|
22
|
-
- 'lib/linter/pronoun_association.rb'
|
23
|
-
|
24
|
-
# Offense count: 1
|
25
|
-
# Cop supports --auto-correct.
|
26
|
-
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
|
27
|
-
# SupportedStylesForExponentOperator: space, no_space
|
28
|
-
Layout/SpaceAroundOperators:
|
29
|
-
Exclude:
|
30
|
-
- 'linter.gemspec'
|
31
|
-
|
32
|
-
# Offense count: 4
|
33
|
-
Lint/IneffectiveAccessModifier:
|
34
|
-
Exclude:
|
35
|
-
- 'lib/linter/gender_association.rb'
|
36
|
-
- 'lib/linter/misused_words.rb'
|
37
|
-
- 'lib/linter/pronoun_association.rb'
|
38
|
-
|
39
|
-
# Offense count: 3
|
40
|
-
# Cop supports --auto-correct.
|
41
|
-
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
|
42
|
-
Lint/UselessAccessModifier:
|
43
|
-
Exclude:
|
44
|
-
- 'lib/linter/gender_association.rb'
|
45
|
-
- 'lib/linter/misused_words.rb'
|
46
|
-
- 'lib/linter/pronoun_association.rb'
|
47
|
-
|
48
|
-
# Offense count: 2
|
49
|
-
# Cop supports --auto-correct.
|
50
|
-
Style/ExpandPathArguments:
|
51
|
-
Exclude:
|
52
|
-
- 'linter.gemspec'
|
53
|
-
|
54
|
-
# Offense count: 1
|
55
|
-
# Cop supports --auto-correct.
|
56
|
-
# Configuration parameters: EnforcedStyle.
|
57
|
-
# SupportedStyles: always, always_true, never
|
58
|
-
Style/FrozenStringLiteralComment:
|
59
|
-
Exclude:
|
60
|
-
- 'linter.gemspec'
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.6.5
|
data/.travis.yml
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,74 +0,0 @@
|
|
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 lienvandensteen@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 [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
linter (0.1.6)
|
5
|
-
colorize (~> 0.8)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
ast (2.4.0)
|
11
|
-
coderay (1.1.3)
|
12
|
-
colorize (0.8.1)
|
13
|
-
diff-lcs (1.3)
|
14
|
-
method_source (1.0.0)
|
15
|
-
parallel (1.19.1)
|
16
|
-
parser (2.7.1.3)
|
17
|
-
ast (~> 2.4.0)
|
18
|
-
pry (0.13.1)
|
19
|
-
coderay (~> 1.1)
|
20
|
-
method_source (~> 1.0)
|
21
|
-
rainbow (3.0.0)
|
22
|
-
rake (10.5.0)
|
23
|
-
rb-readline (0.5.5)
|
24
|
-
regexp_parser (1.7.0)
|
25
|
-
rexml (3.2.4)
|
26
|
-
rspec (3.9.0)
|
27
|
-
rspec-core (~> 3.9.0)
|
28
|
-
rspec-expectations (~> 3.9.0)
|
29
|
-
rspec-mocks (~> 3.9.0)
|
30
|
-
rspec-core (3.9.2)
|
31
|
-
rspec-support (~> 3.9.3)
|
32
|
-
rspec-expectations (3.9.2)
|
33
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
-
rspec-support (~> 3.9.0)
|
35
|
-
rspec-mocks (3.9.1)
|
36
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.9.0)
|
38
|
-
rspec-support (3.9.3)
|
39
|
-
rubocop (0.85.0)
|
40
|
-
parallel (~> 1.10)
|
41
|
-
parser (>= 2.7.0.1)
|
42
|
-
rainbow (>= 2.2.2, < 4.0)
|
43
|
-
regexp_parser (>= 1.7)
|
44
|
-
rexml
|
45
|
-
rubocop-ast (>= 0.0.3)
|
46
|
-
ruby-progressbar (~> 1.7)
|
47
|
-
unicode-display_width (>= 1.4.0, < 2.0)
|
48
|
-
rubocop-ast (0.0.3)
|
49
|
-
parser (>= 2.7.0.1)
|
50
|
-
rubocop-rspec (1.39.0)
|
51
|
-
rubocop (>= 0.68.1)
|
52
|
-
ruby-progressbar (1.10.1)
|
53
|
-
unicode-display_width (1.7.0)
|
54
|
-
|
55
|
-
PLATFORMS
|
56
|
-
ruby
|
57
|
-
|
58
|
-
DEPENDENCIES
|
59
|
-
bundler (~> 1.17)
|
60
|
-
linter!
|
61
|
-
pry
|
62
|
-
rake (~> 10.0)
|
63
|
-
rb-readline
|
64
|
-
rspec (~> 3.0)
|
65
|
-
rubocop (~> 0.85)
|
66
|
-
rubocop-rspec (~> 1.39)
|
67
|
-
|
68
|
-
BUNDLED WITH
|
69
|
-
1.17.2
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'bundler/setup'
|
5
|
-
require 'linter'
|
6
|
-
require 'pry'
|
7
|
-
|
8
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
9
|
-
# with your gem easier. You can also use a different console, if you like.
|
10
|
-
|
11
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
12
|
-
# require 'pry'
|
13
|
-
# Pry.start
|
14
|
-
|
15
|
-
require 'irb'
|
16
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/linter.gemspec
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
lib = File.expand_path('../lib', __FILE__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'linter/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'linter'
|
7
|
-
spec.version = Linter::VERSION
|
8
|
-
spec.authors = ['lien van den steen']
|
9
|
-
spec.email = ['lienvandensteen@gmail.com']
|
10
|
-
|
11
|
-
spec.summary = 'Library to check a text for gender coded language'
|
12
|
-
# spec.description = %q{TODO: Write a longer description or delete this line.}
|
13
|
-
spec.homepage = 'https://gitlab.com/lienvdsteen/linter'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
|
17
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
|
-
if spec.respond_to?(:metadata)
|
19
|
-
# spec.metadata["allowed_push_host"] = "TODO: Set to "http://mygemserver.com"
|
20
|
-
|
21
|
-
spec.metadata['homepage_uri'] = 'https://gitlab.com/lienvdsteen/linter'
|
22
|
-
spec.metadata['source_code_uri'] = 'https://gitlab.com/lienvdsteen/linter'
|
23
|
-
# spec.metadata['changelog_uri'] = 'TODO: Put your gem's CHANGELOG.md URL here.'
|
24
|
-
else
|
25
|
-
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
26
|
-
'public gem pushes.'
|
27
|
-
end
|
28
|
-
|
29
|
-
# Specify which files should be added to the gem when it is released.
|
30
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
31
|
-
# Use expand_path(__dir__) instead of expand_path('..', __FILE__).
|
32
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
33
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
|
-
end
|
35
|
-
spec.bindir = 'exe'
|
36
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
|
-
spec.require_paths = ['lib']
|
38
|
-
|
39
|
-
spec.add_development_dependency 'bundler', '~> 1.17'
|
40
|
-
spec.add_development_dependency 'pry', '~> 0.13'
|
41
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
42
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
43
|
-
spec.add_development_dependency 'rubocop', '~> 0.85'
|
44
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 1.39'
|
45
|
-
|
46
|
-
spec.add_dependency('colorize', '~> 0.8')
|
47
|
-
end
|