linter 0.1.7 → 0.1.8

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: 4ee0b3799a3a7bc06b365832fde6a840832b24bffecb76912329e9ff483f5d37
4
- data.tar.gz: 7a70ccf9e725a720bf947e2118db4d26950aca77595853a04bf00fc74f893026
3
+ metadata.gz: 0d37fc2c12261ce9fc63abee6bc787ae37fceb65591e8d77daf4d363d3b5e237
4
+ data.tar.gz: 72fe17fd2674c5fb5b7f280c4b122f79e0b5f28d30bb054cee844d348392bf67
5
5
  SHA512:
6
- metadata.gz: 7a60ed737b52b82f31c1737f00920272a4c7c05c3203b3c37410aaae04a663851cd528e91ad6a118d9d5d8d79bea356772b33e6ab8a408e82002dd634d782d84
7
- data.tar.gz: 01bd616cfad9a670272796a93990fa8d0d10a218dbed7c04e48416ffad9ccd344de602a060f3260e44265af9fc3a007e90916aadf7d0f36dceaa4a09bea17fc8
6
+ metadata.gz: 4f3c1029a82a2e886080341d60573a1a89397ae6561254ff07d06e7a2100adc7ee39efdc8dd47318bee85a1342797b7c3263d1059ff0bac8bd11c125e46ea937
7
+ data.tar.gz: 914afdd6cf0a6d3a2d1f1e7f409fa754c8d7238079404ebb29dbea626ae12672e60fe75d1699d446cc0cae8b631f7d0e887a84207d6c1e156378a453f0d104b1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- linter (0.1.6)
4
+ linter (0.1.8)
5
5
  colorize (~> 0.8)
6
6
 
7
7
  GEM
@@ -1,112 +1,113 @@
1
- feminine_coded:
2
- - agree
3
- - affectionate
4
- - child*
5
- - cheer
6
- - collab
7
- - commit
8
- - communal
9
- - compassion
10
- - connect
11
- - considerate
12
- - cooperat
13
- - co-operat
14
- - depend
15
- - emotiona
16
- - empath
17
- - feel
18
- - flatterable
19
- - gentle
20
- - honest
21
- - interpersonal
22
- - interdependen
23
- - interpersona
24
- - inter-personal
25
- - inter-dependen
26
- - inter-persona
27
- - kind
28
- - kinship
29
- - loyal
30
- - modesty
31
- - nag
32
- - nurtur
33
- - pleasant
34
- - polite
35
- - quiet*
36
- - respon
37
- - sensitiv
38
- - submissive
39
- - support
40
- - sympath
41
- - tender
42
- - together
43
- - trust
44
- - understand
45
- - warm
46
- - whin
47
- - enthusias
48
- - inclusive
49
- - yield
50
- - share
51
- - sharin
1
+ words:
2
+ feminine_coded:
3
+ - agree
4
+ - affectionate
5
+ - child*
6
+ - cheer
7
+ - collab
8
+ - commit
9
+ - communal
10
+ - compassion
11
+ - connect
12
+ - considerate
13
+ - cooperat
14
+ - co-operat
15
+ - depend
16
+ - emotiona
17
+ - empath
18
+ - feel
19
+ - flatterable
20
+ - gentle
21
+ - honest
22
+ - interpersonal
23
+ - interdependen
24
+ - interpersona
25
+ - inter-personal
26
+ - inter-dependen
27
+ - inter-persona
28
+ - kind
29
+ - kinship
30
+ - loyal
31
+ - modesty
32
+ - nag
33
+ - nurtur
34
+ - pleasant
35
+ - polite
36
+ - quiet*
37
+ - respon
38
+ - sensitiv
39
+ - submissive
40
+ - support
41
+ - sympath
42
+ - tender
43
+ - together
44
+ - trust
45
+ - understand
46
+ - warm
47
+ - whin
48
+ - enthusias
49
+ - inclusive
50
+ - yield
51
+ - share
52
+ - sharin
52
53
 
53
- masculine_coded:
54
- - active
55
- - adventurous
56
- - aggress
57
- - ambitio
58
- - analytics
59
- - analy
60
- - assert
61
- - athlet
62
- - autonom
63
- - battle
64
- - boast
65
- - challeng
66
- - champion
67
- - compet
68
- - confident
69
- - courag
70
- - decid
71
- - decision
72
- - decisive
73
- - defend
74
- - determin
75
- - domina
76
- - dominant
77
- - driven
78
- - fearless
79
- - fight
80
- - force
81
- - guys
82
- - greedy
83
- - head-strong
84
- - headstrong
85
- - hierarch
86
- - hostil
87
- - impulsive
88
- - independen
89
- - individual
90
- - intellect
91
- - lead
92
- - logic
93
- - manpower
94
- - manning
95
- - middleman
96
- - ninja
97
- - objective
98
- - opinion
99
- - outspoken
100
- - persist
101
- - principle
102
- - reckless
103
- - rockstar
104
- - self-confiden
105
- - self-relian
106
- - self-sufficien
107
- - selfconfiden
108
- - selfrelian
109
- - selfsufficien
110
- - stubborn
111
- - superior
112
- - unreasonab
54
+ masculine_coded:
55
+ - active
56
+ - adventurous
57
+ - aggress
58
+ - ambitio
59
+ - analytics
60
+ - analy
61
+ - assert
62
+ - athlet
63
+ - autonom
64
+ - battle
65
+ - boast
66
+ - challeng
67
+ - champion
68
+ - compet
69
+ - confident
70
+ - courag
71
+ - decid
72
+ - decision
73
+ - decisive
74
+ - defend
75
+ - determin
76
+ - domina
77
+ - dominant
78
+ - driven
79
+ - fearless
80
+ - fight
81
+ - force
82
+ - guys
83
+ - greedy
84
+ - head-strong
85
+ - headstrong
86
+ - hierarch
87
+ - hostil
88
+ - impulsive
89
+ - independen
90
+ - individual
91
+ - intellect
92
+ - lead
93
+ - logic
94
+ - manpower
95
+ - manning
96
+ - middleman
97
+ - ninja
98
+ - objective
99
+ - opinion
100
+ - outspoken
101
+ - persist
102
+ - principle
103
+ - reckless
104
+ - rockstar
105
+ - self-confiden
106
+ - self-relian
107
+ - self-sufficien
108
+ - selfconfiden
109
+ - selfrelian
110
+ - selfsufficien
111
+ - stubborn
112
+ - superior
113
+ - unreasonab
@@ -0,0 +1,26 @@
1
+ words:
2
+ growth_coded:
3
+ - striving
4
+ - driven
5
+ - highly motivated
6
+ - improvement
7
+ - learn
8
+ - strive
9
+ - grow
10
+ - persevere
11
+ - determined
12
+
13
+ fixed_coded:
14
+ - est
15
+ - brightest
16
+ - smart
17
+ - performer
18
+ - intelligent
19
+ - rockstar
20
+ - superhero
21
+ - genius
22
+ - expert
23
+ - brilliant
24
+ - natural
25
+ - talent
26
+ - overachieve
@@ -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
@@ -1,11 +1,12 @@
1
- feminine_coded:
2
- - she
3
- - her
4
- - hers
5
- - herself
1
+ words:
2
+ feminine_coded:
3
+ - she
4
+ - her
5
+ - hers
6
+ - herself
6
7
 
7
- masculine_coded:
8
- - he
9
- - his
10
- - him
11
- - himself
8
+ masculine_coded:
9
+ - he
10
+ - his
11
+ - him
12
+ - himself
@@ -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'
@@ -3,18 +3,14 @@
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['feminine_coded'].each do |word|
13
- result.feminine_coded_word_counts.merge!(word_count(text, word))
14
- end
15
-
16
- wordlists['masculine_coded'].each do |word|
17
- result.masculine_coded_word_counts.merge!(word_count(text, word))
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)
@@ -0,0 +1,28 @@
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.fixed_coded_word_counts.values.sum - result.growth_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
+ end
28
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Linter
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
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.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - lien van den steen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-08 00:00:00.000000000 Z
11
+ date: 2020-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -132,12 +132,14 @@ files:
132
132
  - bin/linter
133
133
  - bin/setup
134
134
  - data/gender_association_wordlist.yml
135
+ - data/mindset_wordlist.yml
135
136
  - data/misused_wordlist.yml
136
137
  - data/pronoun_association_wordlist.yml
137
138
  - lib/linter.rb
138
139
  - lib/linter/base_association.rb
139
140
  - lib/linter/cli.rb
140
141
  - lib/linter/gender_association.rb
142
+ - lib/linter/mindset_association.rb
141
143
  - lib/linter/misused_words.rb
142
144
  - lib/linter/pronoun_association.rb
143
145
  - lib/linter/version.rb