query_packwerk 0.1.24 → 0.1.25
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 +4 -4
- data/README.md +9 -1
- data/lib/query_packwerk/cli.rb +14 -2
- data/lib/query_packwerk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 17113dea9c0b350f64d243c1a5006ecdf43852d7f33365f651fe398fe07e0a33
|
|
4
|
+
data.tar.gz: 97a781754bd44f134f48dddcb055ad8708b99bbde8aa78d121cc7d20193a6097
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8587392bb0d8934d219c4d55b933b8102dda8eedc6f5214533f78b6d3cf3fbc17918ae84e4fd3577539f59e9faf51d1bb1f81132af195c650cebfa3585b825a
|
|
7
|
+
data.tar.gz: 92356183da79a996c30433570254c86090c5df4924b0fceb747551253e885298ce1ffc73dc21dd45666e5329f95bbb90a583977a894586820dca941ff951d51c
|
data/README.md
CHANGED
|
@@ -27,6 +27,14 @@ The easiest way to use QueryPackwerk is through its interactive console. This wi
|
|
|
27
27
|
query_packwerk console
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
To use the Packwerk context of another directory, pass it as an argument:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
query_packwerk console path/to/app
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Run `query_packwerk console --help` for usage details.
|
|
37
|
+
|
|
30
38
|
The CLI includes a welcome message with a list of commands. You can access it any time with `welcome`:
|
|
31
39
|
|
|
32
40
|
```
|
|
@@ -116,7 +124,7 @@ QueryPackwerk.anonymous_violation_counts_for("my_pack", threshold: 3)
|
|
|
116
124
|
|
|
117
125
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
118
126
|
|
|
119
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version,
|
|
127
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, bump `VERSION` in `lib/query_packwerk/version.rb` in your PR and run `bundle install` so `Gemfile.lock` matches. When the PR is merged and CI passes on `main`, the gem is tagged and published to RubyGems automatically. Merges that don't change the version don't publish anything.
|
|
120
128
|
|
|
121
129
|
## Contributing
|
|
122
130
|
|
data/lib/query_packwerk/cli.rb
CHANGED
|
@@ -8,12 +8,24 @@ module QueryPackwerk
|
|
|
8
8
|
class CLI < Thor
|
|
9
9
|
extend T::Sig
|
|
10
10
|
|
|
11
|
+
# Thor maps --help to its help command only as the first argument, so commands check options[:help].
|
|
12
|
+
class_option :help, type: :boolean, aliases: '-h', desc: 'Show this help message'
|
|
13
|
+
check_unknown_options!
|
|
14
|
+
|
|
11
15
|
default_command :console
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
sig { returns(T::Boolean) }
|
|
18
|
+
def self.exit_on_failure?
|
|
19
|
+
true
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
desc 'console [DIRECTORY]', 'Query packwerk in DIRECTORY via console'
|
|
23
|
+
long_desc 'Query packwerk in DIRECTORY via console. DIRECTORY defaults to the current directory.'
|
|
15
24
|
sig { params(directory: String).void }
|
|
16
25
|
def console(directory = Dir.pwd)
|
|
26
|
+
return help('console') if options[:help]
|
|
27
|
+
raise Thor::Error, "Could not find directory #{directory.inspect}." unless File.directory?(directory)
|
|
28
|
+
|
|
17
29
|
QueryPackwerk::Console.start(directory)
|
|
18
30
|
end
|
|
19
31
|
end
|