sorbet-schema 0.1.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.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-version +1 -0
  3. data/.standard.yml +6 -0
  4. data/.tool-versions +1 -0
  5. data/CHANGELOG.md +24 -0
  6. data/CODE_OF_CONDUCT.md +84 -0
  7. data/Gemfile +25 -0
  8. data/Gemfile.lock +147 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +43 -0
  11. data/Rakefile +22 -0
  12. data/lib/sorbet-schema/hash_transformer.rb +22 -0
  13. data/lib/sorbet-schema/struct_ext.rb +37 -0
  14. data/lib/sorbet-schema/version.rb +5 -0
  15. data/lib/sorbet-schema.rb +27 -0
  16. data/lib/typed/coercion/coercer.rb +18 -0
  17. data/lib/typed/coercion/coercion_error.rb +7 -0
  18. data/lib/typed/coercion/coercion_not_supported_error.rb +7 -0
  19. data/lib/typed/coercion/float_coercer.rb +21 -0
  20. data/lib/typed/coercion/integer_coercer.rb +21 -0
  21. data/lib/typed/coercion/string_coercer.rb +19 -0
  22. data/lib/typed/coercion/struct_coercer.rb +26 -0
  23. data/lib/typed/coercion.rb +26 -0
  24. data/lib/typed/deserialize_error.rb +6 -0
  25. data/lib/typed/field.rb +28 -0
  26. data/lib/typed/hash_serializer.rb +21 -0
  27. data/lib/typed/json_serializer.rb +28 -0
  28. data/lib/typed/parse_error.rb +12 -0
  29. data/lib/typed/schema.rb +10 -0
  30. data/lib/typed/serializer.rb +61 -0
  31. data/lib/typed/validations/field_type_validator.rb +24 -0
  32. data/lib/typed/validations/field_validator.rb +15 -0
  33. data/lib/typed/validations/multiple_validation_error.rb +16 -0
  34. data/lib/typed/validations/required_field_error.rb +14 -0
  35. data/lib/typed/validations/type_mismatch_error.rb +14 -0
  36. data/lib/typed/validations/validated_value.rb +12 -0
  37. data/lib/typed/validations/validation_error.rb +8 -0
  38. data/lib/typed/validations/validation_results.rb +29 -0
  39. data/lib/typed/validations.rb +8 -0
  40. data/sorbet/config +5 -0
  41. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  42. data/sorbet/rbi/gems/.gitattributes +1 -0
  43. data/sorbet/rbi/gems/ansi@1.5.0.rbi +687 -0
  44. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  45. data/sorbet/rbi/gems/builder@3.2.4.rbi +504 -0
  46. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  47. data/sorbet/rbi/gems/io-console@0.7.2.rbi +8 -0
  48. data/sorbet/rbi/gems/json@2.7.1.rbi +1553 -0
  49. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  50. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +239 -0
  51. data/sorbet/rbi/gems/minitest-focus@1.4.0.rbi +91 -0
  52. data/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi +1010 -0
  53. data/sorbet/rbi/gems/minitest@5.22.2.rbi +2233 -0
  54. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  55. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  56. data/sorbet/rbi/gems/parser@3.3.0.5.rbi +5472 -0
  57. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  58. data/sorbet/rbi/gems/prism@0.24.0.rbi +31040 -0
  59. data/sorbet/rbi/gems/psych@5.1.2.rbi +1731 -0
  60. data/sorbet/rbi/gems/racc@1.7.3.rbi +157 -0
  61. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  62. data/sorbet/rbi/gems/rake@13.1.0.rbi +3027 -0
  63. data/sorbet/rbi/gems/rbi@0.1.9.rbi +3006 -0
  64. data/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +3771 -0
  65. data/sorbet/rbi/gems/reline@0.4.3.rbi +8 -0
  66. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  67. data/sorbet/rbi/gems/rubocop-ast@1.31.1.rbi +7014 -0
  68. data/sorbet/rbi/gems/rubocop-performance@1.20.2.rbi +8 -0
  69. data/sorbet/rbi/gems/rubocop-sorbet@0.7.7.rbi +8 -0
  70. data/sorbet/rbi/gems/rubocop@1.61.0.rbi +57499 -0
  71. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  72. data/sorbet/rbi/gems/sorbet-result@1.1.0.rbi +519 -0
  73. data/sorbet/rbi/gems/sorbet-struct-comparable@1.3.0.rbi +34 -0
  74. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  75. data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +8 -0
  76. data/sorbet/rbi/gems/standard-performance@1.3.1.rbi +80 -0
  77. data/sorbet/rbi/gems/standard-sorbet@0.0.2.rbi +52 -0
  78. data/sorbet/rbi/gems/standard@1.34.0.rbi +850 -0
  79. data/sorbet/rbi/gems/stringio@3.1.0.rbi +8 -0
  80. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23133 -0
  81. data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3499 -0
  82. data/sorbet/rbi/gems/thor@1.3.1.rbi +4351 -0
  83. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  84. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  85. data/sorbet/rbi/gems/yard@0.9.36.rbi +18220 -0
  86. data/sorbet/rbi/gems/zeitwerk@2.6.13.rbi +1003 -0
  87. data/sorbet/tapioca/config.yml +4 -0
  88. data/sorbet/tapioca/require.rb +12 -0
  89. metadata +191 -0
@@ -0,0 +1,8 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `standard-custom` gem.
5
+ # Please instead update this file by running `bin/tapioca gem standard-custom`.
6
+
7
+ # THIS IS AN EMPTY RBI FILE.
8
+ # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
@@ -0,0 +1,80 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `standard-performance` gem.
5
+ # Please instead update this file by running `bin/tapioca gem standard-performance`.
6
+
7
+ # source://standard-performance//lib/standard/performance/version.rb#1
8
+ module Standard; end
9
+
10
+ # source://standard-performance//lib/standard/performance/version.rb#2
11
+ module Standard::Performance; end
12
+
13
+ # source://standard-performance//lib/standard/performance/builds_ruleset.rb#6
14
+ class Standard::Performance::BuildsRuleset
15
+ # @return [BuildsRuleset] a new instance of BuildsRuleset
16
+ #
17
+ # source://standard-performance//lib/standard/performance/builds_ruleset.rb#7
18
+ def initialize; end
19
+
20
+ # source://standard-performance//lib/standard/performance/builds_ruleset.rb#13
21
+ def build(target_ruby_version); end
22
+ end
23
+
24
+ # source://standard-performance//lib/standard/performance/determines_yaml_path.rb#3
25
+ class Standard::Performance::DeterminesYamlPath
26
+ # source://standard-performance//lib/standard/performance/determines_yaml_path.rb#4
27
+ def determine(desired_version); end
28
+ end
29
+
30
+ # source://standard-performance//lib/standard/performance/loads_yaml_with_inheritance.rb#5
31
+ class Standard::Performance::LoadsYamlWithInheritance
32
+ # source://standard-performance//lib/standard/performance/loads_yaml_with_inheritance.rb#6
33
+ def load(path); end
34
+
35
+ private
36
+
37
+ # source://standard-performance//lib/standard/performance/loads_yaml_with_inheritance.rb#20
38
+ def two_layer_merge(parent, base); end
39
+ end
40
+
41
+ # source://standard-performance//lib/standard/performance/plugin.rb#4
42
+ class Standard::Performance::Plugin < ::LintRoller::Plugin
43
+ # @return [Plugin] a new instance of Plugin
44
+ #
45
+ # source://standard-performance//lib/standard/performance/plugin.rb#5
46
+ def initialize(config); end
47
+
48
+ # source://standard-performance//lib/standard/performance/plugin.rb#10
49
+ def about; end
50
+
51
+ # source://standard-performance//lib/standard/performance/plugin.rb#23
52
+ def rules(context); end
53
+
54
+ # @return [Boolean]
55
+ #
56
+ # source://standard-performance//lib/standard/performance/plugin.rb#19
57
+ def supported?(context); end
58
+
59
+ private
60
+
61
+ # This is not fantastic.
62
+ #
63
+ # When you `require "rubocop-performance"`, it will not only load the cops,
64
+ # but it will also monkey-patch RuboCop's default_configuration, which is
65
+ # something that can't be undone for the lifetime of the process.
66
+ #
67
+ # See: https://github.com/rubocop/rubocop-performance/commit/587050a8c0ec6d2fa64f5be970425a7f4c5d779b
68
+ #
69
+ # As an alternative, standard-performance loads the cops directly, and then
70
+ # simply tells the RuboCop config loader that it's been loaded. This is
71
+ # taking advantage of a private API of an `attr_reader` that probably wasn't
72
+ # meant to be mutated externally, but it's better than the `Inject` monkey
73
+ # patching that rubocop-performance does (and many other RuboCop plugins do)
74
+ #
75
+ # source://standard-performance//lib/standard/performance/plugin.rb#48
76
+ def trick_rubocop_into_thinking_we_required_rubocop_performance!; end
77
+ end
78
+
79
+ # source://standard-performance//lib/standard/performance/version.rb#3
80
+ Standard::Performance::VERSION = T.let(T.unsafe(nil), String)
@@ -0,0 +1,52 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `standard-sorbet` gem.
5
+ # Please instead update this file by running `bin/tapioca gem standard-sorbet`.
6
+
7
+ # source://standard-sorbet//lib/standard/sorbet/version.rb#1
8
+ module Standard; end
9
+
10
+ # source://standard-sorbet//lib/standard/sorbet/version.rb#2
11
+ module Standard::Sorbet; end
12
+
13
+ # source://standard-sorbet//lib/standard/sorbet/plugin.rb#2
14
+ class Standard::Sorbet::Plugin < ::LintRoller::Plugin
15
+ # @return [Plugin] a new instance of Plugin
16
+ #
17
+ # source://standard-sorbet//lib/standard/sorbet/plugin.rb#3
18
+ def initialize(config); end
19
+
20
+ # source://standard-sorbet//lib/standard/sorbet/plugin.rb#8
21
+ def about; end
22
+
23
+ # source://standard-sorbet//lib/standard/sorbet/plugin.rb#21
24
+ def rules(context); end
25
+
26
+ # @return [Boolean]
27
+ #
28
+ # source://standard-sorbet//lib/standard/sorbet/plugin.rb#17
29
+ def supported?(context); end
30
+
31
+ private
32
+
33
+ # This is not fantastic.
34
+ #
35
+ # When you `require "rubocop-sorbet"`, it will not only load the cops,
36
+ # but it will also monkey-patch RuboCop's default_configuration, which is
37
+ # something that can't be undone for the lifetime of the process.
38
+ #
39
+ # See: https://github.com/Shopify/rubocop-sorbet/blob/main/lib/rubocop/sorbet/inject.rb
40
+ #
41
+ # As an alternative, standard-sorbet loads the cops directly, and then
42
+ # simply tells the RuboCop config loader that it's been loaded. This is
43
+ # taking advantage of a private API of an `attr_reader` that probably wasn't
44
+ # meant to be mutated externally, but it's better than the `Inject` monkey
45
+ # patching that rubocop-sorbet does (and many other RuboCop plugins do)
46
+ #
47
+ # source://standard-sorbet//lib/standard/sorbet/plugin.rb#51
48
+ def trick_rubocop_into_thinking_we_required_rubocop_sorbet!; end
49
+ end
50
+
51
+ # source://standard-sorbet//lib/standard/sorbet/version.rb#3
52
+ Standard::Sorbet::VERSION = T.let(T.unsafe(nil), String)