linter 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1491108b230614cf20851e598c1011f4c57569e2f1a3b0ca1fbda04d495fa0b0
4
- data.tar.gz: ff1f19b671c4226aa09a4ff7269aad26fa0302962107ce7197476518f6bf5868
3
+ metadata.gz: 5f6c8116c4b1a24d73d27bba7a73c1a0c181d7c7cc33d1ae752b688de68cf9fa
4
+ data.tar.gz: e2824833060c739d59ae5634e6a61752bc30fa957b186fcfe818dea0f292f995
5
5
  SHA512:
6
- metadata.gz: 99d9a231422877c17f46e91e9882417ab489389396e4382e7d35547aadced0f87c54e3c78cd40fb58e358c019446fb532dd87345aa4a0ae12ec2a2cb997d4c92
7
- data.tar.gz: d6cc2a01478d094a8bf712f0d6447e5ee36d7cc37e505addee6648e4b0dd33c9f7bd567f4dabc61a15c4fb88812d00ded97181e38a0378727fe9286af744bb0a
6
+ metadata.gz: aceb6c6039b820decb927586cdce44206aff07fc280de67cf9d206a914e2bbc2120bc7166784a46b4d5a8b42d056063e3385f12f4f38c7b7d10dff94196f9c78
7
+ data.tar.gz: 2ef6e8ecbe3a073501b081f5e8ef43053b64b3af1e086172b95aa09f29fd2ac2f6ab3c6aea6eb380768edaa7812fd5f51173612982cf57dd1f90d97fbbde366a
data/README.md CHANGED
@@ -30,6 +30,13 @@ text = 'your text here'
30
30
  response = Linter.analyze(text)
31
31
  ```
32
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
+
33
40
  You can also use the checks individually:
34
41
 
35
42
  ```ruby
@@ -47,13 +54,15 @@ Linter::MisusedWords.analyze(text)
47
54
  ```
48
55
 
49
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
50
- masculine-coded language, the text will be marked as such. The regular checks (like `MisusedWords`) will return all the misused words, a reason why
51
- and if possible, we provide some suggestions to replace the word.
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.
52
61
 
53
- ## CLI Usage -> In development
62
+ ## CLI Usage
54
63
 
55
64
  ```console
56
- linter example.md
65
+ linter path/to_file/example.md
57
66
  #<OpenStruct feminine_coded_word_counts={}, masculine_coded_word_counts={"analytical"=>1}, trend="strongly masculine-coded">
58
67
  #<OpenStruct feminine_coded_word_counts={}, masculine_coded_word_counts={"he"=>1}, trend="masculine-coded">
59
68
  ```
@@ -74,6 +83,8 @@ We are looking for different types of contributions:
74
83
  - support for other languages besides English
75
84
  - ...
76
85
 
86
+ If you add any checks or words, please also add the sources used to the `sources.yml` file.
87
+
77
88
  ## License
78
89
 
79
90
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -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>.
@@ -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
@@ -25,5 +25,10 @@ module Linter
25
25
  response[:mindset_association_analysis] = Linter::MindsetAssociation.analyze(text) if job_ad
26
26
  response
27
27
  end
28
+
29
+ def sources
30
+ file_path = File.join(__dir__, '../data/sources.yml')
31
+ YAML.load_file(file_path)
32
+ end
28
33
  end
29
34
  end
@@ -14,6 +14,7 @@ module Linter
14
14
  end
15
15
 
16
16
  result.trend = calculate_trend(result)
17
+ result.recommendation = add_recommendation(result)
17
18
  result
18
19
  end
19
20
 
@@ -34,5 +35,14 @@ module Linter
34
35
  .transform_values(&:size)
35
36
  .to_h
36
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
37
47
  end
38
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
@@ -24,5 +24,9 @@ module Linter
24
24
  'fixed-coded'
25
25
  end
26
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
27
31
  end
28
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Linter
4
- VERSION = '0.1.11'
4
+ VERSION = '0.1.12'
5
5
  end
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.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - lien van den steen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-26 00:00:00.000000000 Z
11
+ date: 2020-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -137,6 +137,8 @@ files:
137
137
  - data/mindset_wordlist.yml
138
138
  - data/misused_wordlist.yml
139
139
  - data/pronoun_association_wordlist.yml
140
+ - data/recommendations.yml
141
+ - data/sources.yml
140
142
  - lib/linter.rb
141
143
  - lib/linter/base_association.rb
142
144
  - lib/linter/cli.rb