linter 0.1.8 → 0.1.9

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: 0d37fc2c12261ce9fc63abee6bc787ae37fceb65591e8d77daf4d363d3b5e237
4
- data.tar.gz: 72fe17fd2674c5fb5b7f280c4b122f79e0b5f28d30bb054cee844d348392bf67
3
+ metadata.gz: a80c5734dad74a7737293169a71422fc05f45e75662615ee1b135e4efd96332e
4
+ data.tar.gz: cadc9e3c07b8fde011e5a0688efc9d309082d7a0f587a8d6ef616da25c3bd311
5
5
  SHA512:
6
- metadata.gz: 4f3c1029a82a2e886080341d60573a1a89397ae6561254ff07d06e7a2100adc7ee39efdc8dd47318bee85a1342797b7c3263d1059ff0bac8bd11c125e46ea937
7
- data.tar.gz: 914afdd6cf0a6d3a2d1f1e7f409fa754c8d7238079404ebb29dbea626ae12672e60fe75d1699d446cc0cae8b631f7d0e887a84207d6c1e156378a453f0d104b1
6
+ metadata.gz: b36c820823c1e67f49ce474ad589665d4e98fe4c8256656ede53b203de79137a1749e1c9d5acabf056d923b3c1db02d663bfdb075bf403656eb757d15b9e849e
7
+ data.tar.gz: 360c60b81bf244368b9a9e5421b641c3bd34d16436b252342aadd64c85eeae39601ccc3d44f0efe03521aa8db23770b5ee4722e75293f78b0a1639993507a9cd
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- linter (0.1.8)
4
+ linter (0.1.9)
5
5
  colorize (~> 0.8)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -23,15 +23,34 @@ 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
+ You can also use the checks individually:
34
+
26
35
  ```ruby
27
36
  text = 'Collaborate closely with the manager. Analytics all the way.'
28
37
  Linter::GenderAssociation.analyze(text)
29
38
  # #<OpenStruct feminine_coded_word_counts={"collaborate" => 1}, masculine_coded_word_counts={"analytics" => 1}, trend="neutral">
39
+
30
40
  text = 'He was working at the bar.'
31
41
  Linter::PronounAssociation.analyze(text)
42
+ #<OpenStruct trend="masculine-coded", feminine_coded_word_counts={}, masculine_coded_word_counts={"he"=>1}>
43
+
44
+ text = 'You are my spirit animal'
45
+ Linter::MisusedWords.analyze(text)
46
+ #<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
47
  ```
33
48
 
34
- ## CLI Usage -> currently broken
49
+ 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.
52
+
53
+ ## CLI Usage -> In development
35
54
 
36
55
  ```console
37
56
  linter example.md
@@ -47,7 +66,13 @@ To install this gem onto your local machine, run `bundle exec rake install`.
47
66
 
48
67
  ## Contributing
49
68
 
50
- Bug reports and pull 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.
69
+ 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.
70
+
71
+ We are looking for different types of contributions:
72
+ - additional checks
73
+ - adding/editing words to the existing wordlists
74
+ - support for other languages besides English
75
+ - ...
51
76
 
52
77
  ## License
53
78
 
@@ -16,8 +16,12 @@ module Linter
16
16
  class Error < StandardError; end
17
17
 
18
18
  class << self
19
- def cli_analyze(file_name)
20
- Linter::CLI.analyze(file_name)
19
+ def analyze(text)
20
+ {
21
+ gender_association_analysis: Linter::GenderAssociation.analyze(text),
22
+ pronoun_analysis: Linter::PronounAssociation.analyze(text),
23
+ misused_words_analysis: Linter::MisusedWords.analyze(text)
24
+ }
21
25
  end
22
26
  end
23
27
  end
@@ -11,7 +11,7 @@ module Linter
11
11
  end
12
12
 
13
13
  def self.calculate_trend(result)
14
- case result.fixed_coded_word_counts.values.sum - result.growth_coded_word_counts.values.sum
14
+ case result.growth_coded_word_counts.values.sum - result.fixed_coded_word_counts.values.sum
15
15
  when 0
16
16
  'neutral'
17
17
  when 1..3
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Linter
4
- VERSION = '0.1.8'
4
+ VERSION = '0.1.9'
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.8
4
+ version: 0.1.9
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-11 00:00:00.000000000 Z
11
+ date: 2020-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler