danger-packwerk 0.11.2 → 0.13.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 +4 -4
- data/lib/danger-packwerk/check/default_formatter.rb +1 -1
- data/lib/danger-packwerk/private.rb +1 -1
- data/lib/danger-packwerk/update/default_formatter.rb +1 -1
- data/lib/danger-packwerk/version.rb +1 -1
- data/sorbet/rbi/gems/{packwerk@2.2.1-7428f23e243a4a172ddb4e28021a732e2c9abc1a.rbi → packwerk@2.2.1-e998ef65194de398f0baaf03a0ba33390b30351e.rbi} +44 -44
- data/sorbet/tapioca/require.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88dd6cf3e1597ce88a505eaa638404b5ec37733adbfd08c121d2ea1718ff4c80
|
4
|
+
data.tar.gz: 37c3d43dfba549cab2d536fd38a0ad080968d5277f21ac6a9c7fadb2100dbdec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee1bb1ca1f19f6a47d3766bd823bf83a7c8d8c5441e703aec6e8404d036cf02be80d00f6ab9feceb03d791d603497216bb9a7834b2454a947b07c6ef89276869
|
7
|
+
data.tar.gz: 2c0802e7bb7ce6100fcc63d27ded9071fea2e3661cc0cd622188581f4056f44110a61bf1e0936a43ca5baeca33d02d2abe65c4eb35debe9291739d00cd0f8e38
|
@@ -38,7 +38,7 @@ module DangerPackwerk
|
|
38
38
|
constant_source_package = T.must(ParsePackwerk.all.find { |p| p.name == constant_source_package_name })
|
39
39
|
constant_source_package_ownership_info = Private::OwnershipInformation.for_package(constant_source_package, org_name)
|
40
40
|
|
41
|
-
disclaimer = 'Before you run `bin/packwerk update-
|
41
|
+
disclaimer = 'Before you run `bin/packwerk update-todo`, check out these quick suggestions:'
|
42
42
|
referencing_code_in_right_pack = "- Does the code you are writing live in the right pack?\n - If not, try `bin/packs move packs/destination_pack #{referencing_file}`"
|
43
43
|
referenced_code_in_right_pack = "- Does #{constant_name} live in the right pack?\n - If not, try `bin/packs move packs/destination_pack #{constant_location}`"
|
44
44
|
dependency_violation_message = "- Do we actually want to depend on #{constant_source_package_name}?\n - If so, try `bin/packs add_dependency #{referencing_file_pack} #{constant_source_package_name}`\n - If not, what can we change about the design so we do not have to depend on #{constant_source_package_name}?"
|
@@ -14,7 +14,7 @@ module DangerPackwerk
|
|
14
14
|
def self.constant_resolver
|
15
15
|
@constant_resolver = T.let(@constant_resolver, T.nilable(ConstantResolver))
|
16
16
|
@constant_resolver ||= begin
|
17
|
-
load_paths = Packwerk::
|
17
|
+
load_paths = Packwerk::RailsLoadPaths.for(Dir.pwd, environment: 'test')
|
18
18
|
ConstantResolver.new(
|
19
19
|
root_path: Dir.pwd,
|
20
20
|
load_paths: T.unsafe(load_paths).keys
|
@@ -28,7 +28,7 @@ module DangerPackwerk
|
|
28
28
|
|
29
29
|
package_referring_to_constant_owner = Private::OwnershipInformation.for_package(referencing_file_pack, org_name)
|
30
30
|
|
31
|
-
disclaimer = 'We noticed you ran `bin/packwerk update-
|
31
|
+
disclaimer = 'We noticed you ran `bin/packwerk update-todo`. Check out [the docs](https://github.com/Shopify/packwerk/blob/main/RESOLVING_VIOLATIONS.md) to see other ways to resolve violations.'
|
32
32
|
pluralized_violation = offenses.count > 1 ? 'these violations' : 'this violation'
|
33
33
|
request_to_add_context = "- Could you add some context as a reply here about why we needed to add #{pluralized_violation}?\n"
|
34
34
|
|
@@ -9,50 +9,6 @@ module Packwerk
|
|
9
9
|
extend ::ActiveSupport::Autoload
|
10
10
|
end
|
11
11
|
|
12
|
-
# Extracts the load paths from the analyzed application so that we can map constant names to paths.
|
13
|
-
#
|
14
|
-
# source://packwerk//lib/packwerk/application_load_paths.rb#8
|
15
|
-
module Packwerk::ApplicationLoadPaths
|
16
|
-
class << self
|
17
|
-
# source://packwerk//lib/packwerk/application_load_paths.rb#22
|
18
|
-
sig { returns(T::Hash[::String, ::Module]) }
|
19
|
-
def extract_application_autoload_paths; end
|
20
|
-
|
21
|
-
# source://packwerk//lib/packwerk/application_load_paths.rb#13
|
22
|
-
sig { params(root: ::String, environment: ::String).returns(T::Hash[::String, ::Module]) }
|
23
|
-
def extract_relevant_paths(root, environment); end
|
24
|
-
|
25
|
-
# source://packwerk//lib/packwerk/application_load_paths.rb#32
|
26
|
-
sig do
|
27
|
-
params(
|
28
|
-
all_paths: T::Hash[::String, ::Module],
|
29
|
-
bundle_path: ::Pathname,
|
30
|
-
rails_root: ::Pathname
|
31
|
-
).returns(T::Hash[::Pathname, ::Module])
|
32
|
-
end
|
33
|
-
def filter_relevant_paths(all_paths, bundle_path: T.unsafe(nil), rails_root: T.unsafe(nil)); end
|
34
|
-
|
35
|
-
# source://packwerk//lib/packwerk/application_load_paths.rb#43
|
36
|
-
sig do
|
37
|
-
params(
|
38
|
-
load_paths: T::Hash[::Pathname, ::Module],
|
39
|
-
rails_root: ::Pathname
|
40
|
-
).returns(T::Hash[::String, ::Module])
|
41
|
-
end
|
42
|
-
def relative_path_strings(load_paths, rails_root: T.unsafe(nil)); end
|
43
|
-
|
44
|
-
private
|
45
|
-
|
46
|
-
# source://packwerk//lib/packwerk/application_load_paths.rb#63
|
47
|
-
sig { params(paths: T::Hash[T.untyped, ::Module]).void }
|
48
|
-
def assert_load_paths_present(paths); end
|
49
|
-
|
50
|
-
# source://packwerk//lib/packwerk/application_load_paths.rb#50
|
51
|
-
sig { params(root: ::String, environment: ::String).void }
|
52
|
-
def require_application(root, environment); end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
12
|
# Checks the structure of the application and its packwerk configuration to make sure we can run a check and deliver
|
57
13
|
# correct results.
|
58
14
|
#
|
@@ -1697,6 +1653,50 @@ end
|
|
1697
1653
|
# source://packwerk//lib/packwerk/package_set.rb#8
|
1698
1654
|
Packwerk::PathSpec = T.type_alias { T.any(::String, T::Array[::String]) }
|
1699
1655
|
|
1656
|
+
# Extracts the load paths from the analyzed application so that we can map constant names to paths.
|
1657
|
+
#
|
1658
|
+
# source://packwerk//lib/packwerk/rails_load_paths.rb#10
|
1659
|
+
module Packwerk::RailsLoadPaths
|
1660
|
+
class << self
|
1661
|
+
# source://packwerk//lib/packwerk/rails_load_paths.rb#15
|
1662
|
+
sig { params(root: ::String, environment: ::String).returns(T::Hash[::String, ::Module]) }
|
1663
|
+
def for(root, environment:); end
|
1664
|
+
|
1665
|
+
private
|
1666
|
+
|
1667
|
+
# source://packwerk//lib/packwerk/rails_load_paths.rb#65
|
1668
|
+
sig { params(paths: T::Hash[T.untyped, ::Module]).void }
|
1669
|
+
def assert_load_paths_present(paths); end
|
1670
|
+
|
1671
|
+
# source://packwerk//lib/packwerk/rails_load_paths.rb#26
|
1672
|
+
sig { returns(T::Hash[::String, ::Module]) }
|
1673
|
+
def extract_application_autoload_paths; end
|
1674
|
+
|
1675
|
+
# source://packwerk//lib/packwerk/rails_load_paths.rb#36
|
1676
|
+
sig do
|
1677
|
+
params(
|
1678
|
+
all_paths: T::Hash[::String, ::Module],
|
1679
|
+
bundle_path: ::Pathname,
|
1680
|
+
rails_root: ::Pathname
|
1681
|
+
).returns(T::Hash[::Pathname, ::Module])
|
1682
|
+
end
|
1683
|
+
def filter_relevant_paths(all_paths, bundle_path: T.unsafe(nil), rails_root: T.unsafe(nil)); end
|
1684
|
+
|
1685
|
+
# source://packwerk//lib/packwerk/rails_load_paths.rb#47
|
1686
|
+
sig do
|
1687
|
+
params(
|
1688
|
+
load_paths: T::Hash[::Pathname, ::Module],
|
1689
|
+
rails_root: ::Pathname
|
1690
|
+
).returns(T::Hash[::String, ::Module])
|
1691
|
+
end
|
1692
|
+
def relative_path_strings(load_paths, rails_root: T.unsafe(nil)); end
|
1693
|
+
|
1694
|
+
# source://packwerk//lib/packwerk/rails_load_paths.rb#52
|
1695
|
+
sig { params(root: ::String, environment: ::String).void }
|
1696
|
+
def require_application(root, environment); end
|
1697
|
+
end
|
1698
|
+
end
|
1699
|
+
|
1700
1700
|
# A reference from a file in one package to a constant that may be defined in a different package.
|
1701
1701
|
#
|
1702
1702
|
# source://packwerk//lib/packwerk/reference.rb#6
|
data/sorbet/tapioca/require.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-packwerk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: code_ownership
|
@@ -260,7 +260,7 @@ files:
|
|
260
260
|
- sorbet/rbi/gems/nokogiri@1.13.8.rbi
|
261
261
|
- sorbet/rbi/gems/octokit@5.6.1.rbi
|
262
262
|
- sorbet/rbi/gems/open4@1.3.4.rbi
|
263
|
-
- sorbet/rbi/gems/packwerk@2.2.1-
|
263
|
+
- sorbet/rbi/gems/packwerk@2.2.1-e998ef65194de398f0baaf03a0ba33390b30351e.rbi
|
264
264
|
- sorbet/rbi/gems/parallel@1.22.1.rbi
|
265
265
|
- sorbet/rbi/gems/parse_packwerk@0.16.0.rbi
|
266
266
|
- sorbet/rbi/gems/parser@3.1.2.1.rbi
|