danger-typos 0.1.0 → 0.2.0

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: 7ca58a8024d01464f7d5f9b3849b6fc4ee9917864415af35b4c3e46df7eed4c4
4
- data.tar.gz: 2e651317a64d71f85634a1dcab2b9ad31e447d9ddc335694cdb3c529715fc028
3
+ metadata.gz: 06630b2718951c3956bc974c02fdd0e8b0580acf490c57883b694814d5b919f8
4
+ data.tar.gz: a4b9aa7d63372f3429fb6d27c12b50d0f7bd277e0478b440286116df2714ea3a
5
5
  SHA512:
6
- metadata.gz: 3b27895cc1ad3b248bc8594374f5832c244368daa950f350dc8e36f68ca5be2940116b263340892599083ac22ac448a4ad16573e5b573c42035cbfc2b311ceee
7
- data.tar.gz: b4c12aacdde430d2d523f807dfb9f49bc36f5c79fb9aa21bf0937b9d3363a075a285fc86655e4c7cc2801932c0cb30b17ec2d3ac038e58dc2b98442e7bbe1c3a
6
+ metadata.gz: cd09fc19bb9e4b2d28819669fceede3c801d9dbf096dbd07ae7b96df190d7477aacfe4ff0d544b7036ca075e996857f18556a94f7b97364f31c8bb80c185d663
7
+ data.tar.gz: d78d14624a81b759f51d4b83effb6db0bf02695f577ae6d8d1e52bb0277874672f5581e5596b00da6b48cfbd8ffa19adfade279a5b3f0d73c306f865ba43985c
data/README.md CHANGED
@@ -12,17 +12,26 @@
12
12
 
13
13
  Add this to Dangerfile.
14
14
 
15
- ```
15
+ ```ruby
16
16
  typos.run
17
17
  ```
18
18
 
19
19
  If you want to specify typos bin file, you can set a bin path to the binary_path parameter.
20
20
 
21
- ```
21
+ ```ruby
22
22
  typos.binary_path = "path/to/typos"
23
23
  typos.run
24
24
  ```
25
25
 
26
+ To use a custom config file, set the config_path parameter.
27
+
28
+ ```ruby
29
+ typos.run config_path: "_typos.toml"
30
+ ```
31
+
32
+ ## Example
33
+
34
+ <img width="320" src="https://github.com/user-attachments/assets/0fa06466-e945-454e-8d61-73c5cbe8a8ce" />
26
35
 
27
36
  ### GitHub actions
28
37
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Typos
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/typos/plugin.rb CHANGED
@@ -21,10 +21,16 @@ module Danger
21
21
 
22
22
  # Execute typos
23
23
  # @return [void]
24
- def run
24
+ def run(options = {})
25
25
  return if target_files.empty?
26
26
 
27
- args = ["--force-exclude", "--format", "json"] + target_files
27
+ args = [
28
+ "--force-exclude",
29
+ "--format", "json"
30
+ ]
31
+ args.push("--config", options[:config_path]) if options[:config_path]
32
+ args += target_files
33
+
28
34
  stdout, = Open3.capture3(cmd_path, *args)
29
35
 
30
36
  stdout.split("\n").each do |result|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-typos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyosuke Takayama
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-02-15 00:00:00.000000000 Z
10
+ date: 2025-02-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: danger-plugin-api