linter 0.1.4 → 0.1.5

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: '08b1ff0198e0f6f389ee13707020581608ac96eadff6cb34a0e47821aa6d03d6'
4
- data.tar.gz: b9d3e3b3d42cb76e7df568da374488b0c8047d19cc1985f38a34021e5720fd22
3
+ metadata.gz: ceb622ab960b3b1acc543c89e7547c308a279a26dbe4093c305184932559e801
4
+ data.tar.gz: a000bbffd2abb54812bd1762bca8985121f5d0b7c9736ff07b4d7184ce58ebf3
5
5
  SHA512:
6
- metadata.gz: 1a9e8cc02d838eac96ab0952f009d0281104fd63ee25e8846a76143f56be0d64a8704abb8a08d579b2009fb010f94e7914ef2395457f05861d1d734992cf24e6
7
- data.tar.gz: 9b857bd50998ef0e71696c78fe77e89262545c94e02b8f67008a9f87d46887bc6387e08feda977be6f4c1829c05ff1ea5212207b0234217004fee17491735559
6
+ metadata.gz: 89b07c343065872b75590dfc757718550c8114522229f9aa9ad21f3ff0d1b48a68de49f2903da78e5d6a72d832ad4af139c089e58d53719cbdbc8f9c32b68255
7
+ data.tar.gz: 9db243a571e737dd07b08939360807f7172eb9e050cd2f05f196cd21961e4af7587728fde8a3917a6f2f416eaceb7334e32b427db9b5e145dbb9bec73fa2ecf7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- linter (0.1.4)
4
+ linter (0.1.5)
5
5
  colorize (~> 0.8)
6
6
 
7
7
  GEM
@@ -0,0 +1,112 @@
1
+ problematic:
2
+ - word: spirit animal
3
+ reason: |
4
+ The problem is that spirit animals are an important part of the belief
5
+ system of some cultures and refer to a spirit that “helps guide or protect
6
+ a person on a journey and whose characteristics that person shares or
7
+ embodies.” Referring to something as your spirit animal is cultural
8
+ appropriation. Avoid using it.
9
+ replace_with:
10
+ - kindred spirit
11
+ - raison d'etre
12
+ - word: sherpa
13
+ reason: |
14
+ Unless you mean someone who hails from Tibetan stock and lives in the
15
+ Nepalese Himalayas serving as a porter on mountain-climbing expeditions,
16
+ it is not a Sherpa.
17
+ replace_with:
18
+ - guide
19
+ - coach
20
+ - word: guru
21
+ reason: |
22
+ The word guru comes from Buddhist and Hindu religions and refers to a
23
+ spiritual guide or leader who is held in high esteem. Using the term
24
+ casually in referring to yourself or someone is disrespectful because it
25
+ diminishes the importance of the title and its origins.
26
+ replace_with:
27
+ - doyen
28
+ - virtuoso
29
+ - authority
30
+ - maestro
31
+ - word: ninja
32
+ reason: |
33
+ The term’s origins refer to “a member of a feudal Japanese society of
34
+ mercenary agents, highly trained in martial arts and stealth (ninjutsu),
35
+ who were hired for covert purposes ranging from espionage to sabotage and
36
+ assassination.” People misuse the term to claim expertise in an area.
37
+ replace_with:
38
+ - expert
39
+ - whiz
40
+ - ace
41
+ - word: nazi
42
+ reason: |
43
+ It describes people who were members of the National Socialist German
44
+ Workers’ Party, which controlled Germany from 1933–1945 under Adolf Hitler.
45
+ Using the term casually, as in grammar Nazi or fun Nazi, makes light of
46
+ the horrible atrocities they committed.
47
+ replace_with:
48
+ - boss
49
+ - absolutist
50
+ - word: binge
51
+ reason: |
52
+ We throw around terms like binge-watch and cleaning binge all the time
53
+ when, in fact, the word binge originates from serious eating disorders,
54
+ including Binge Eating Disorder and bulimia, and should be reserved for
55
+ discussions about them. Choosing to watch every episode of The Office in a
56
+ weekend is a choice, whereas bingeing disorders are not a choice and their
57
+ severity shouldn’t be diminished.
58
+ replace_with:
59
+ - indulged
60
+ - spree
61
+ - wallowed
62
+ - satiated
63
+ - word: scalp
64
+ reason: |
65
+ Used as a noun to refer to the top of your head, scalp is fine. It’s when
66
+ it’s used as a verb that we get into dangerous territory.
67
+
68
+ Using it to say someone ripped you off or to infer that you got robbed is
69
+ making light of what was a very gruesome act involving “a part of [the]
70
+ integument [of the upper part of the head] with the accompanying hair,
71
+ severed from the head of an enemy as a sign of victory, as by some North
72
+ American Indians and others during the colonial and frontier periods in
73
+ the US.”
74
+ replace_with:
75
+ - fleeced
76
+ - robbed
77
+ - hustled
78
+ - pulled a fast one
79
+ - word: gyp
80
+ reason: |
81
+ It comes from the word Gypsy, who are Romani people. There are already
82
+ plenty of negative associations with the term gypsy, and using gypped to
83
+ say you got ripped off only perpetuates the negative stereotypes.
84
+ replace_with:
85
+ - ripoff
86
+ - bamboozled
87
+ - shortchanged
88
+ - fraud
89
+ - word: hysterical
90
+ reason: |
91
+ If you find something or someone to be hysterical, meaning funny, that’s
92
+ OK. If you’re calling someone’s actions hysterical because they’re being
93
+ emotional, then you may want to reconsider.
94
+
95
+ Far too often women are dubbed hysterical for being outspoken or showing
96
+ their feelings, and that wades into problematic, sexist territory due to
97
+ the history of the term.
98
+
99
+ Hysterical’s earliest meaning was “of, relating to, or characterized by
100
+ hysteria,” and while we now think of hysteria as irrational panic, it was,
101
+ for centuries, a medical diagnosis. Hysteria comes from the Greek
102
+ hysterikós, which means “suffering in the womb.”
103
+
104
+ So, yeah, the ancient Greeks believed that when a woman was behaving
105
+ irrationally—or in a way that they considered to be irrational—it was
106
+ because her uterus was literally wandering around her body causing trouble
107
+ (Kory Stamper, “What It Really Means To Call A Woman Hysterical“).
108
+ replace_with:
109
+ - intense
110
+ - impassioned
111
+ - piercing
112
+ - vehement
@@ -3,6 +3,7 @@ require_relative "linter/base_association"
3
3
  require_relative "linter/gender_association"
4
4
  require_relative "linter/pronoun_association"
5
5
  require_relative "linter/cli"
6
+ require_relative "linter/misused_words"
6
7
 
7
8
  require 'yaml'
8
9
  require 'colorize'
@@ -0,0 +1,23 @@
1
+ module Linter
2
+ class MisusedWords
3
+ def self.analyze(text)
4
+ result = OpenStruct.new(
5
+ misused_words: [],
6
+ trend: ''
7
+ )
8
+ wordlists.dig('problematic').each do |problematic_word|
9
+ word = problematic_word['word']
10
+ regex = /\b#{word}\b/i
11
+ result.misused_words << problematic_word if text.scan(regex).any?
12
+ end
13
+ result
14
+ end
15
+
16
+ private
17
+
18
+ def self.wordlists
19
+ file_path = File.join(__dir__,'../../data/misused_wordlist.yml')
20
+ @wordlists ||= YAML.load_file(file_path)
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Linter
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - lien van den steen
@@ -102,11 +102,13 @@ files:
102
102
  - bin/linter
103
103
  - bin/setup
104
104
  - data/gender_association_wordlist.yml
105
+ - data/misused_wordlist.yml
105
106
  - data/pronoun_association_wordlist.yml
106
107
  - lib/linter.rb
107
108
  - lib/linter/base_association.rb
108
109
  - lib/linter/cli.rb
109
110
  - lib/linter/gender_association.rb
111
+ - lib/linter/misused_words.rb
110
112
  - lib/linter/pronoun_association.rb
111
113
  - lib/linter/version.rb
112
114
  - linter.gemspec