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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 392d286b38084a21900d3cfe40e81f79f7e6eff5ca872327551589688b309d85
4
- data.tar.gz: 5bc5556fbc5279b3d8056757067ec696e362ab2860251cc6cefc403223f89ce6
3
+ metadata.gz: 17113dea9c0b350f64d243c1a5006ecdf43852d7f33365f651fe398fe07e0a33
4
+ data.tar.gz: 97a781754bd44f134f48dddcb055ad8708b99bbde8aa78d121cc7d20193a6097
5
5
  SHA512:
6
- metadata.gz: 5f99589b97b415a4f98d404b5270e368b201353ce0b5107f70f3341b43c9f6590cae133a4cc0cdd6decc6eb1c0d67a373fbef15df439beed841653bcec6ac4a0
7
- data.tar.gz: 9ede139265993386cbfbd3e5a9987b00d658865af3d4a3833f0bf41b0d723e84da51c91737b49175a37c52f1668b2671655030ee19a2628e910644416084b7e9
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, push a PR with the label for the version you want, like 'major', 'minor' or 'patch'. When the PR is merged, the version will be automatically released to RubyGems.
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
 
@@ -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
- desc 'console',
14
- 'Query packwerk in the current directory via console'
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
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module QueryPackwerk
5
- VERSION = '0.1.24'
5
+ VERSION = '0.1.25'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_packwerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineering