danger-packwerk 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger-packwerk/packwerk_wrapper.rb +2 -2
- data/lib/danger-packwerk/version.rb +1 -1
- data/sorbet/config +1 -0
- data/sorbet/rbi/gems/actionview@7.0.4.rbi +11543 -0
- data/sorbet/rbi/gems/activesupport@7.0.4.rbi +12959 -0
- data/sorbet/rbi/gems/addressable@2.8.1.rbi +1505 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +522 -0
- data/sorbet/rbi/gems/better_html@2.0.1.rbi +286 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
- data/sorbet/rbi/gems/claide-plugins@0.9.2.rbi +791 -0
- data/sorbet/rbi/gems/claide@1.1.0.rbi +1132 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +2256 -0
- data/sorbet/rbi/gems/colored2@3.1.2.rbi +130 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +8695 -0
- data/sorbet/rbi/gems/cork@0.3.0.rbi +248 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +436 -0
- data/sorbet/rbi/gems/danger-plugin-api@1.0.0.rbi +8 -0
- data/sorbet/rbi/gems/danger@9.0.0.rbi +4722 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +862 -0
- data/sorbet/rbi/gems/erubi@1.11.0.rbi +102 -0
- data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +266 -0
- data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +209 -0
- data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +212 -0
- data/sorbet/rbi/gems/faraday-http-cache@2.4.1.rbi +805 -0
- data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +221 -0
- data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +266 -0
- data/sorbet/rbi/gems/faraday-net_http@1.0.1.rbi +216 -0
- data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +206 -0
- data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +212 -0
- data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +225 -0
- data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +222 -0
- data/sorbet/rbi/gems/faraday@1.10.2.rbi +1862 -0
- data/sorbet/rbi/gems/git@1.12.0.rbi +1936 -0
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +1643 -0
- data/sorbet/rbi/gems/json@2.6.2.rbi +1418 -0
- data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +8 -0
- data/sorbet/rbi/gems/kramdown@2.4.0.rbi +2168 -0
- data/sorbet/rbi/gems/loofah@2.19.0.rbi +646 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +199 -0
- data/sorbet/rbi/gems/minitest@5.16.3.rbi +997 -0
- data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +165 -0
- data/sorbet/rbi/gems/nap@1.1.0.rbi +351 -0
- data/sorbet/rbi/gems/no_proxy_fix@0.1.2.rbi +8 -0
- data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +4916 -0
- data/sorbet/rbi/gems/octokit@5.6.1.rbi +8939 -0
- data/sorbet/rbi/gems/open4@1.3.4.rbi +8 -0
- data/sorbet/rbi/gems/{packwerk@2.1.1.rbi → packwerk@2.2.1.rbi} +602 -51
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +163 -0
- data/sorbet/rbi/gems/parser@3.1.2.1.rbi +5988 -0
- data/sorbet/rbi/gems/pry@0.14.1.rbi +6969 -0
- data/sorbet/rbi/gems/public_suffix@5.0.0.rbi +779 -0
- data/sorbet/rbi/gems/racc@1.6.0.rbi +92 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +8 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +493 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +227 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +1865 -0
- data/sorbet/rbi/gems/rbi@0.0.14.rbi +2337 -0
- data/sorbet/rbi/gems/rchardet@1.8.0.rbi +587 -0
- data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +1851 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +3852 -0
- data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +7725 -0
- data/sorbet/rbi/gems/rspec-expectations@3.11.0.rbi +6201 -0
- data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +3625 -0
- data/sorbet/rbi/gems/rspec-support@3.11.0.rbi +1176 -0
- data/sorbet/rbi/gems/rspec@3.11.0.rbi +40 -0
- data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +4193 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi +677 -0
- data/sorbet/rbi/gems/rubocop@1.36.0.rbi +37914 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +732 -0
- data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
- data/sorbet/rbi/gems/sawyer@0.9.2.rbi +513 -0
- data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +326 -0
- data/sorbet/rbi/gems/spoom@1.1.11.rbi +1600 -0
- data/sorbet/rbi/gems/tapioca@0.8.0.rbi +1959 -0
- data/sorbet/rbi/gems/terminal-table@3.0.2.rbi +438 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +2921 -0
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +4879 -0
- data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +27 -0
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +2789 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +1802 -0
- data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +288 -0
- data/sorbet/rbi/gems/yard@0.9.27.rbi +12668 -0
- data/sorbet/rbi/todo.rbi +122 -0
- metadata +84 -7
- data/sorbet/rbi/gems/danger@8.5.0.rbi +0 -122
@@ -0,0 +1,248 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `cork` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem cork`.
|
6
|
+
|
7
|
+
module Cork; end
|
8
|
+
|
9
|
+
# provides support for UI output. Cork provides support for nested
|
10
|
+
# sections of information and for a verbose mode.
|
11
|
+
class Cork::Board
|
12
|
+
# Initialize a new instance.
|
13
|
+
#
|
14
|
+
# @param verbose [Boolean] When verbose is true verbose output is printed.
|
15
|
+
# this defaults to true
|
16
|
+
# @param silent [Boolean] When silent is true all output is supressed.
|
17
|
+
# This defaults to false.
|
18
|
+
# @param ansi [Boolean] When ansi is true output may contain ansi
|
19
|
+
# color codes. This is true by default.
|
20
|
+
# @param input [IO] The file descriptor to read the user input.
|
21
|
+
# @param out [IO] The file descriptor to print all output to.
|
22
|
+
# @param err [IO] The file descriptor to print all errors to.
|
23
|
+
# @return [Board] a new instance of Board
|
24
|
+
def initialize(verbose: T.unsafe(nil), silent: T.unsafe(nil), ansi: T.unsafe(nil), input: T.unsafe(nil), out: T.unsafe(nil), err: T.unsafe(nil)); end
|
25
|
+
|
26
|
+
# Returns the value of attribute ansi.
|
27
|
+
def ansi; end
|
28
|
+
|
29
|
+
# Returns the value of attribute ansi.
|
30
|
+
def ansi?; end
|
31
|
+
|
32
|
+
# @return [Bool] Whether the wrapping of the strings to the width of the
|
33
|
+
# terminal should be disabled.
|
34
|
+
def disable_wrap; end
|
35
|
+
|
36
|
+
# @return [Bool] Whether the wrapping of the strings to the width of the
|
37
|
+
# terminal should be disabled.
|
38
|
+
def disable_wrap=(_arg0); end
|
39
|
+
|
40
|
+
# @return [Bool] Whether the wrapping of the strings to the width of the
|
41
|
+
# terminal should be disabled.
|
42
|
+
def disable_wrap?; end
|
43
|
+
|
44
|
+
# @return [error] The error specification containing the UI error.
|
45
|
+
def err; end
|
46
|
+
|
47
|
+
# Gets input from the configured input.
|
48
|
+
def gets; end
|
49
|
+
|
50
|
+
# Returns the value of attribute indentation_level.
|
51
|
+
def indentation_level; end
|
52
|
+
|
53
|
+
# Prints an info to the user. The info is always displayed.
|
54
|
+
# It respects the current indentation level only in verbose
|
55
|
+
# mode.
|
56
|
+
#
|
57
|
+
# Any title printed in the optional block is treated as a message.
|
58
|
+
#
|
59
|
+
# @param message [String] The message to print.
|
60
|
+
def info(message); end
|
61
|
+
|
62
|
+
# @return [input] The input specification that contains the user input
|
63
|
+
# for the UI.
|
64
|
+
def input; end
|
65
|
+
|
66
|
+
# Prints a message with a label.
|
67
|
+
#
|
68
|
+
# @param label [String] The label to print.
|
69
|
+
# @param value [#to_s] The value to print.
|
70
|
+
# @param justification [FixNum] The justification of the label.
|
71
|
+
def labeled(label, value, justification = T.unsafe(nil)); end
|
72
|
+
|
73
|
+
# Prints a verbose message taking an optional verbose prefix and
|
74
|
+
# a relative indentation valid for the UI action in the passed
|
75
|
+
# block.
|
76
|
+
#
|
77
|
+
# @todo Clean interface.
|
78
|
+
def message(message, verbose_prefix = T.unsafe(nil), relative_indentation = T.unsafe(nil)); end
|
79
|
+
|
80
|
+
# Prints a verbose message taking an optional verbose prefix and
|
81
|
+
# a relatvie indentation valid for the UI action in the passed block.
|
82
|
+
def notice(message); end
|
83
|
+
|
84
|
+
# @return [output] The output specification containing the UI output.
|
85
|
+
def out; end
|
86
|
+
|
87
|
+
# The returned path is quoted. If the argument is nil it returns an empty
|
88
|
+
# string.
|
89
|
+
#
|
90
|
+
# @param pathname [#to_str, Nil] The path to return.
|
91
|
+
# @param relative_to [Pathname]
|
92
|
+
def path(pathname, relative_to = T.unsafe(nil)); end
|
93
|
+
|
94
|
+
# Prints a message without a new line unless silent.
|
95
|
+
def print(message); end
|
96
|
+
|
97
|
+
# Prints the stored warnings. This method is intended to be called at the
|
98
|
+
# end of the execution of the binary.
|
99
|
+
#
|
100
|
+
# @return [void]
|
101
|
+
def print_warnings; end
|
102
|
+
|
103
|
+
# Prints a message followed by a new line unless silent.
|
104
|
+
def puts(message = T.unsafe(nil)); end
|
105
|
+
|
106
|
+
# Prints a message respecting the current indentation level and
|
107
|
+
# wrapping it to the terminal width if necessary.
|
108
|
+
def puts_indented(message = T.unsafe(nil)); end
|
109
|
+
|
110
|
+
# Prints a title taking an optional verbose prefix and
|
111
|
+
# a relative indentation valid for the UI action in the passed
|
112
|
+
# block.
|
113
|
+
#
|
114
|
+
# In verbose mode titles are printed with a color according
|
115
|
+
# to their level. In normal mode titles are printed only if
|
116
|
+
# they have nesting level smaller than 2.
|
117
|
+
#
|
118
|
+
# @param title [String] The title to print
|
119
|
+
# @param verbose_prefix [String] See #message
|
120
|
+
# @param relative_indentation [FixNum] The indentation level relative to the current,
|
121
|
+
# when the message is printed.
|
122
|
+
# @todo Refactor to title (for always visible titles like search)
|
123
|
+
# and sections (titles that represent collapsible sections).
|
124
|
+
def section(title, verbose_prefix = T.unsafe(nil), relative_indentation = T.unsafe(nil), titled = T.unsafe(nil)); end
|
125
|
+
|
126
|
+
# Returns the value of attribute silent.
|
127
|
+
def silent; end
|
128
|
+
|
129
|
+
# Returns the value of attribute silent.
|
130
|
+
def silent?; end
|
131
|
+
|
132
|
+
# A title opposed to a section is always visible
|
133
|
+
#
|
134
|
+
# @param title [String] The title to print
|
135
|
+
# @param verbose_prefix [String] See #message
|
136
|
+
# @param relative_indentation [FixNum] The indentation level relative to the current,
|
137
|
+
# when the message is printed.
|
138
|
+
def title(title, verbose_prefix = T.unsafe(nil), relative_indentation = T.unsafe(nil)); end
|
139
|
+
|
140
|
+
# Returns the value of attribute verbose.
|
141
|
+
def verbose; end
|
142
|
+
|
143
|
+
# Returns the value of attribute verbose.
|
144
|
+
def verbose?; end
|
145
|
+
|
146
|
+
# Stores important warning to the user optionally followed by actions that
|
147
|
+
# the user should take. To print them use {#print_warnings}.
|
148
|
+
#
|
149
|
+
# @param [String] message The message to print.
|
150
|
+
# @param [Array] actions The actions that the user should take.
|
151
|
+
# @param [Boolean] verbose_only When verbose_only is configured to
|
152
|
+
# true, the warning will only be printed when
|
153
|
+
# Board is configured to print verbose messages.
|
154
|
+
# This is false by default.
|
155
|
+
#
|
156
|
+
# @return [void]
|
157
|
+
def warn(message, actions = T.unsafe(nil), verbose_only = T.unsafe(nil)); end
|
158
|
+
|
159
|
+
# @return [warnings] The warnings specification containing the UI warnings.
|
160
|
+
def warnings; end
|
161
|
+
|
162
|
+
private
|
163
|
+
|
164
|
+
# Sets the attribute indentation_level
|
165
|
+
#
|
166
|
+
# @param value the value to set the attribute indentation_level to.
|
167
|
+
def indentation_level=(_arg0); end
|
168
|
+
|
169
|
+
def puts_title(title, verbose_prefix); end
|
170
|
+
|
171
|
+
# Returns the value of attribute title_level.
|
172
|
+
def title_level; end
|
173
|
+
|
174
|
+
# Sets the attribute title_level
|
175
|
+
#
|
176
|
+
# @param value the value to set the attribute title_level to.
|
177
|
+
def title_level=(_arg0); end
|
178
|
+
|
179
|
+
# Prints a title taking an optional verbose prefix and
|
180
|
+
# a relative indentation valid for the UI action in the passed
|
181
|
+
# block.
|
182
|
+
#
|
183
|
+
# In verbose mode titles are printed with a color according
|
184
|
+
# to their level. In normal mode titles are printed only if
|
185
|
+
# they have nesting level smaller than 2.
|
186
|
+
#
|
187
|
+
# @param title [String] The title to print
|
188
|
+
# @param verbose_prefix [String] See #message
|
189
|
+
# @param relative_indentation [FixNum] The indentation level relative to the current,
|
190
|
+
# when the message is printed.
|
191
|
+
# @todo Refactor to title (for always visible titles like search)
|
192
|
+
# and sections (titles that represent collapsible sections).
|
193
|
+
def wrap_string(string, indent = T.unsafe(nil)); end
|
194
|
+
end
|
195
|
+
|
196
|
+
module Cork::TextWrapper
|
197
|
+
private
|
198
|
+
|
199
|
+
# @return [String] Lifted straigth from Actionview. Thanks Guys!
|
200
|
+
def strip_heredoc(string); end
|
201
|
+
|
202
|
+
# @return [String] Lifted straigth from Actionview. Thanks Guys!
|
203
|
+
def word_wrap(line, line_width); end
|
204
|
+
|
205
|
+
# @param string [String] The string to format.
|
206
|
+
# @param indent [Fixnum] The number of spaces to insert before the string.
|
207
|
+
# @param width [Fixnum] The width to use to format the string if the terminal
|
208
|
+
# is too wide.
|
209
|
+
# @return [String] Wraps a formatted string (e.g. markdown) by stripping
|
210
|
+
# heredoc indentation and wrapping by word to the terminal width
|
211
|
+
# taking into account a maximum one, and indenting the string.
|
212
|
+
# Code lines (i.e. indented by four spaces) are not wrapped.
|
213
|
+
def wrap_formatted_text(string, indent = T.unsafe(nil), width = T.unsafe(nil)); end
|
214
|
+
|
215
|
+
# @param string [String] The string to indent.
|
216
|
+
# @param indent [Fixnum] The number of spaces to insert before the string.
|
217
|
+
# @param width [Fixnum] The width to use when formatting the string in the terminal
|
218
|
+
# @return [String] Wraps a string to the terminal width taking into
|
219
|
+
# account the given indentation.
|
220
|
+
def wrap_with_indent(string, indent = T.unsafe(nil), width = T.unsafe(nil)); end
|
221
|
+
|
222
|
+
class << self
|
223
|
+
# @return [String] Lifted straigth from Actionview. Thanks Guys!
|
224
|
+
def strip_heredoc(string); end
|
225
|
+
|
226
|
+
# @return [String] Lifted straigth from Actionview. Thanks Guys!
|
227
|
+
def word_wrap(line, line_width); end
|
228
|
+
|
229
|
+
# @param string [String] The string to format.
|
230
|
+
# @param indent [Fixnum] The number of spaces to insert before the string.
|
231
|
+
# @param width [Fixnum] The width to use to format the string if the terminal
|
232
|
+
# is too wide.
|
233
|
+
# @return [String] Wraps a formatted string (e.g. markdown) by stripping
|
234
|
+
# heredoc indentation and wrapping by word to the terminal width
|
235
|
+
# taking into account a maximum one, and indenting the string.
|
236
|
+
# Code lines (i.e. indented by four spaces) are not wrapped.
|
237
|
+
def wrap_formatted_text(string, indent = T.unsafe(nil), width = T.unsafe(nil)); end
|
238
|
+
|
239
|
+
# @param string [String] The string to indent.
|
240
|
+
# @param indent [Fixnum] The number of spaces to insert before the string.
|
241
|
+
# @param width [Fixnum] The width to use when formatting the string in the terminal
|
242
|
+
# @return [String] Wraps a string to the terminal width taking into
|
243
|
+
# account the given indentation.
|
244
|
+
def wrap_with_indent(string, indent = T.unsafe(nil), width = T.unsafe(nil)); end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
Cork::VERSION = T.let(T.unsafe(nil), String)
|
@@ -0,0 +1,436 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `crass` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem crass`.
|
6
|
+
|
7
|
+
# A CSS parser based on the CSS Syntax Module Level 3 spec.
|
8
|
+
module Crass
|
9
|
+
class << self
|
10
|
+
# Parses _input_ as a CSS stylesheet and returns a parse tree.
|
11
|
+
#
|
12
|
+
# See {Tokenizer#initialize} for _options_.
|
13
|
+
def parse(input, options = T.unsafe(nil)); end
|
14
|
+
|
15
|
+
# Parses _input_ as a string of CSS properties (such as the contents of an
|
16
|
+
# HTML element's `style` attribute) and returns a parse tree.
|
17
|
+
#
|
18
|
+
# See {Tokenizer#initialize} for _options_.
|
19
|
+
def parse_properties(input, options = T.unsafe(nil)); end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# Parses a CSS string or list of tokens.
|
24
|
+
#
|
25
|
+
# 5. http://dev.w3.org/csswg/css-syntax/#parsing
|
26
|
+
class Crass::Parser
|
27
|
+
# Initializes a parser based on the given _input_, which may be a CSS string
|
28
|
+
# or an array of tokens.
|
29
|
+
#
|
30
|
+
# See {Tokenizer#initialize} for _options_.
|
31
|
+
#
|
32
|
+
# @return [Parser] a new instance of Parser
|
33
|
+
def initialize(input, options = T.unsafe(nil)); end
|
34
|
+
|
35
|
+
# Consumes an at-rule and returns it.
|
36
|
+
#
|
37
|
+
# 5.4.2. http://dev.w3.org/csswg/css-syntax-3/#consume-at-rule
|
38
|
+
def consume_at_rule(input = T.unsafe(nil)); end
|
39
|
+
|
40
|
+
# Consumes a component value and returns it, or `nil` if there are no more
|
41
|
+
# tokens.
|
42
|
+
#
|
43
|
+
# 5.4.6. http://dev.w3.org/csswg/css-syntax-3/#consume-a-component-value
|
44
|
+
def consume_component_value(input = T.unsafe(nil)); end
|
45
|
+
|
46
|
+
# Consumes a declaration and returns it, or `nil` on parse error.
|
47
|
+
#
|
48
|
+
# 5.4.5. http://dev.w3.org/csswg/css-syntax-3/#consume-a-declaration
|
49
|
+
def consume_declaration(input = T.unsafe(nil)); end
|
50
|
+
|
51
|
+
# Consumes a list of declarations and returns them.
|
52
|
+
#
|
53
|
+
# By default, the returned list may include `:comment`, `:semicolon`, and
|
54
|
+
# `:whitespace` nodes, which is non-standard.
|
55
|
+
#
|
56
|
+
# Options:
|
57
|
+
#
|
58
|
+
# * **:strict** - Set to `true` to exclude non-standard `:comment`,
|
59
|
+
# `:semicolon`, and `:whitespace` nodes.
|
60
|
+
#
|
61
|
+
# 5.4.4. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-declarations
|
62
|
+
def consume_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end
|
63
|
+
|
64
|
+
# Consumes a function and returns it.
|
65
|
+
#
|
66
|
+
# 5.4.8. http://dev.w3.org/csswg/css-syntax-3/#consume-a-function
|
67
|
+
def consume_function(input = T.unsafe(nil)); end
|
68
|
+
|
69
|
+
# Consumes a qualified rule and returns it, or `nil` if a parse error
|
70
|
+
# occurs.
|
71
|
+
#
|
72
|
+
# 5.4.3. http://dev.w3.org/csswg/css-syntax-3/#consume-a-qualified-rule
|
73
|
+
def consume_qualified_rule(input = T.unsafe(nil)); end
|
74
|
+
|
75
|
+
# Consumes a list of rules and returns them.
|
76
|
+
#
|
77
|
+
# 5.4.1. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-rules
|
78
|
+
def consume_rules(flags = T.unsafe(nil)); end
|
79
|
+
|
80
|
+
# Consumes and returns a simple block associated with the current input
|
81
|
+
# token.
|
82
|
+
#
|
83
|
+
# 5.4.7. http://dev.w3.org/csswg/css-syntax/#consume-a-simple-block
|
84
|
+
def consume_simple_block(input = T.unsafe(nil)); end
|
85
|
+
|
86
|
+
# Creates and returns a new parse node with the given _properties_.
|
87
|
+
def create_node(type, properties = T.unsafe(nil)); end
|
88
|
+
|
89
|
+
# Parses the given _input_ tokens into a selector node and returns it.
|
90
|
+
#
|
91
|
+
# Doesn't bother splitting the selector list into individual selectors or
|
92
|
+
# validating them. Feel free to do that yourself! It'll be fun!
|
93
|
+
def create_selector(input); end
|
94
|
+
|
95
|
+
# Creates a `:style_rule` node from the given qualified _rule_, and returns
|
96
|
+
# it.
|
97
|
+
def create_style_rule(rule); end
|
98
|
+
|
99
|
+
# Parses a single component value and returns it.
|
100
|
+
#
|
101
|
+
# 5.3.7. http://dev.w3.org/csswg/css-syntax-3/#parse-a-component-value
|
102
|
+
def parse_component_value(input = T.unsafe(nil)); end
|
103
|
+
|
104
|
+
# Parses a list of component values and returns an array of parsed tokens.
|
105
|
+
#
|
106
|
+
# 5.3.8. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-component-values
|
107
|
+
def parse_component_values(input = T.unsafe(nil)); end
|
108
|
+
|
109
|
+
# Parses a single declaration and returns it.
|
110
|
+
#
|
111
|
+
# 5.3.5. http://dev.w3.org/csswg/css-syntax/#parse-a-declaration
|
112
|
+
def parse_declaration(input = T.unsafe(nil)); end
|
113
|
+
|
114
|
+
# Parses a list of declarations and returns them.
|
115
|
+
#
|
116
|
+
# See {#consume_declarations} for _options_.
|
117
|
+
#
|
118
|
+
# 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations
|
119
|
+
def parse_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end
|
120
|
+
|
121
|
+
# Parses a list of declarations and returns an array of `:property` nodes
|
122
|
+
# (and any non-declaration nodes that were in the input). This is useful for
|
123
|
+
# parsing the contents of an HTML element's `style` attribute.
|
124
|
+
def parse_properties(input = T.unsafe(nil)); end
|
125
|
+
|
126
|
+
# Parses a single rule and returns it.
|
127
|
+
#
|
128
|
+
# 5.3.4. http://dev.w3.org/csswg/css-syntax-3/#parse-a-rule
|
129
|
+
def parse_rule(input = T.unsafe(nil)); end
|
130
|
+
|
131
|
+
# Returns the unescaped value of a selector name or property declaration.
|
132
|
+
def parse_value(nodes); end
|
133
|
+
|
134
|
+
# {TokenScanner} wrapping the tokens generated from this parser's input.
|
135
|
+
def tokens; end
|
136
|
+
|
137
|
+
class << self
|
138
|
+
# Parses CSS properties (such as the contents of an HTML element's `style`
|
139
|
+
# attribute) and returns a parse tree.
|
140
|
+
#
|
141
|
+
# See {Tokenizer#initialize} for _options_.
|
142
|
+
#
|
143
|
+
# 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations
|
144
|
+
def parse_properties(input, options = T.unsafe(nil)); end
|
145
|
+
|
146
|
+
# Parses CSS rules (such as the content of a `@media` block) and returns a
|
147
|
+
# parse tree. The only difference from {parse_stylesheet} is that CDO/CDC
|
148
|
+
# nodes (`<!--` and `-->`) aren't ignored.
|
149
|
+
#
|
150
|
+
# See {Tokenizer#initialize} for _options_.
|
151
|
+
#
|
152
|
+
# 5.3.3. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-rules
|
153
|
+
def parse_rules(input, options = T.unsafe(nil)); end
|
154
|
+
|
155
|
+
# Parses a CSS stylesheet and returns a parse tree.
|
156
|
+
#
|
157
|
+
# See {Tokenizer#initialize} for _options_.
|
158
|
+
#
|
159
|
+
# 5.3.2. http://dev.w3.org/csswg/css-syntax/#parse-a-stylesheet
|
160
|
+
def parse_stylesheet(input, options = T.unsafe(nil)); end
|
161
|
+
|
162
|
+
# Converts a node or array of nodes into a CSS string based on their
|
163
|
+
# original tokenized input.
|
164
|
+
#
|
165
|
+
# Options:
|
166
|
+
#
|
167
|
+
# * **:exclude_comments** - When `true`, comments will be excluded.
|
168
|
+
def stringify(nodes, options = T.unsafe(nil)); end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
Crass::Parser::BLOCK_END_TOKENS = T.let(T.unsafe(nil), Hash)
|
173
|
+
|
174
|
+
# Similar to a StringScanner, but with extra functionality needed to tokenize
|
175
|
+
# CSS while preserving the original text.
|
176
|
+
class Crass::Scanner
|
177
|
+
# Creates a Scanner instance for the given _input_ string or IO instance.
|
178
|
+
#
|
179
|
+
# @return [Scanner] a new instance of Scanner
|
180
|
+
def initialize(input); end
|
181
|
+
|
182
|
+
# Consumes the next character and returns it, advancing the pointer, or
|
183
|
+
# an empty string if the end of the string has been reached.
|
184
|
+
def consume; end
|
185
|
+
|
186
|
+
# Consumes the rest of the string and returns it, advancing the pointer to
|
187
|
+
# the end of the string. Returns an empty string is the end of the string
|
188
|
+
# has already been reached.
|
189
|
+
def consume_rest; end
|
190
|
+
|
191
|
+
# Current character, or `nil` if the scanner hasn't yet consumed a
|
192
|
+
# character, or is at the end of the string.
|
193
|
+
def current; end
|
194
|
+
|
195
|
+
# Returns `true` if the end of the string has been reached, `false`
|
196
|
+
# otherwise.
|
197
|
+
#
|
198
|
+
# @return [Boolean]
|
199
|
+
def eos?; end
|
200
|
+
|
201
|
+
# Sets the marker to the position of the next character that will be
|
202
|
+
# consumed.
|
203
|
+
def mark; end
|
204
|
+
|
205
|
+
# Returns the substring between {#marker} and {#pos}, without altering the
|
206
|
+
# pointer.
|
207
|
+
def marked; end
|
208
|
+
|
209
|
+
# Current marker position. Use {#marked} to get the substring between
|
210
|
+
# {#marker} and {#pos}.
|
211
|
+
def marker; end
|
212
|
+
|
213
|
+
# Current marker position. Use {#marked} to get the substring between
|
214
|
+
# {#marker} and {#pos}.
|
215
|
+
def marker=(_arg0); end
|
216
|
+
|
217
|
+
# Returns up to _length_ characters starting at the current position, but
|
218
|
+
# doesn't consume them. The number of characters returned may be less than
|
219
|
+
# _length_ if the end of the string is reached.
|
220
|
+
def peek(length = T.unsafe(nil)); end
|
221
|
+
|
222
|
+
# Position of the next character that will be consumed. This is a character
|
223
|
+
# position, not a byte position, so it accounts for multi-byte characters.
|
224
|
+
def pos; end
|
225
|
+
|
226
|
+
# Position of the next character that will be consumed. This is a character
|
227
|
+
# position, not a byte position, so it accounts for multi-byte characters.
|
228
|
+
def pos=(_arg0); end
|
229
|
+
|
230
|
+
# Moves the pointer back one character without changing the value of
|
231
|
+
# {#current}. The next call to {#consume} will re-consume the current
|
232
|
+
# character.
|
233
|
+
def reconsume; end
|
234
|
+
|
235
|
+
# Resets the pointer to the beginning of the string.
|
236
|
+
def reset; end
|
237
|
+
|
238
|
+
# Tries to match _pattern_ at the current position. If it matches, the
|
239
|
+
# matched substring will be returned and the pointer will be advanced.
|
240
|
+
# Otherwise, `nil` will be returned.
|
241
|
+
def scan(pattern); end
|
242
|
+
|
243
|
+
# Scans the string until the _pattern_ is matched. Returns the substring up
|
244
|
+
# to and including the end of the match, and advances the pointer. If there
|
245
|
+
# is no match, `nil` is returned and the pointer is not advanced.
|
246
|
+
def scan_until(pattern); end
|
247
|
+
|
248
|
+
# String being scanned.
|
249
|
+
def string; end
|
250
|
+
end
|
251
|
+
|
252
|
+
# Like {Scanner}, but for tokens!
|
253
|
+
class Crass::TokenScanner
|
254
|
+
# @return [TokenScanner] a new instance of TokenScanner
|
255
|
+
def initialize(tokens); end
|
256
|
+
|
257
|
+
# Executes the given block, collects all tokens that are consumed during its
|
258
|
+
# execution, and returns them.
|
259
|
+
def collect; end
|
260
|
+
|
261
|
+
# Consumes the next token and returns it, advancing the pointer. Returns
|
262
|
+
# `nil` if there is no next token.
|
263
|
+
def consume; end
|
264
|
+
|
265
|
+
# Returns the value of attribute current.
|
266
|
+
def current; end
|
267
|
+
|
268
|
+
# Returns the next token without consuming it, or `nil` if there is no next
|
269
|
+
# token.
|
270
|
+
def peek; end
|
271
|
+
|
272
|
+
# Returns the value of attribute pos.
|
273
|
+
def pos; end
|
274
|
+
|
275
|
+
# Reconsumes the current token, moving the pointer back one position.
|
276
|
+
#
|
277
|
+
# http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#reconsume-the-current-input-token
|
278
|
+
def reconsume; end
|
279
|
+
|
280
|
+
# Resets the pointer to the first token in the list.
|
281
|
+
def reset; end
|
282
|
+
|
283
|
+
# Returns the value of attribute tokens.
|
284
|
+
def tokens; end
|
285
|
+
end
|
286
|
+
|
287
|
+
# Tokenizes a CSS string.
|
288
|
+
#
|
289
|
+
# 4. http://dev.w3.org/csswg/css-syntax/#tokenization
|
290
|
+
class Crass::Tokenizer
|
291
|
+
# Initializes a new Tokenizer.
|
292
|
+
#
|
293
|
+
# Options:
|
294
|
+
#
|
295
|
+
# * **:preserve_comments** - If `true`, comments will be preserved as
|
296
|
+
# `:comment` tokens.
|
297
|
+
#
|
298
|
+
# * **:preserve_hacks** - If `true`, certain non-standard browser hacks
|
299
|
+
# such as the IE "*" hack will be preserved even though they violate
|
300
|
+
# CSS 3 syntax rules.
|
301
|
+
#
|
302
|
+
# @return [Tokenizer] a new instance of Tokenizer
|
303
|
+
def initialize(input, options = T.unsafe(nil)); end
|
304
|
+
|
305
|
+
# Consumes a token and returns the token that was consumed.
|
306
|
+
#
|
307
|
+
# 4.3.1. http://dev.w3.org/csswg/css-syntax/#consume-a-token
|
308
|
+
def consume; end
|
309
|
+
|
310
|
+
# Consumes the remnants of a bad URL and returns the consumed text.
|
311
|
+
#
|
312
|
+
# 4.3.15. http://dev.w3.org/csswg/css-syntax/#consume-the-remnants-of-a-bad-url
|
313
|
+
def consume_bad_url; end
|
314
|
+
|
315
|
+
# Consumes comments and returns them, or `nil` if no comments were consumed.
|
316
|
+
#
|
317
|
+
# 4.3.2. http://dev.w3.org/csswg/css-syntax/#consume-comments
|
318
|
+
def consume_comments; end
|
319
|
+
|
320
|
+
# Consumes an escaped code point and returns its unescaped value.
|
321
|
+
#
|
322
|
+
# This method assumes that the `\` has already been consumed, and that the
|
323
|
+
# next character in the input has already been verified not to be a newline
|
324
|
+
# or EOF.
|
325
|
+
#
|
326
|
+
# 4.3.8. http://dev.w3.org/csswg/css-syntax/#consume-an-escaped-code-point
|
327
|
+
def consume_escaped; end
|
328
|
+
|
329
|
+
# Consumes an ident-like token and returns it.
|
330
|
+
#
|
331
|
+
# 4.3.4. http://dev.w3.org/csswg/css-syntax/#consume-an-ident-like-token
|
332
|
+
def consume_ident; end
|
333
|
+
|
334
|
+
# Consumes a name and returns it.
|
335
|
+
#
|
336
|
+
# 4.3.12. http://dev.w3.org/csswg/css-syntax/#consume-a-name
|
337
|
+
def consume_name; end
|
338
|
+
|
339
|
+
# Consumes a number and returns a 3-element array containing the number's
|
340
|
+
# original representation, its numeric value, and its type (either
|
341
|
+
# `:integer` or `:number`).
|
342
|
+
#
|
343
|
+
# 4.3.13. http://dev.w3.org/csswg/css-syntax/#consume-a-number
|
344
|
+
def consume_number; end
|
345
|
+
|
346
|
+
# Consumes a numeric token and returns it.
|
347
|
+
#
|
348
|
+
# 4.3.3. http://dev.w3.org/csswg/css-syntax/#consume-a-numeric-token
|
349
|
+
def consume_numeric; end
|
350
|
+
|
351
|
+
# Consumes a string token that ends at the given character, and returns the
|
352
|
+
# token.
|
353
|
+
#
|
354
|
+
# 4.3.5. http://dev.w3.org/csswg/css-syntax/#consume-a-string-token
|
355
|
+
def consume_string(ending = T.unsafe(nil)); end
|
356
|
+
|
357
|
+
# Consumes a Unicode range token and returns it. Assumes the initial "u+" or
|
358
|
+
# "U+" has already been consumed.
|
359
|
+
#
|
360
|
+
# 4.3.7. http://dev.w3.org/csswg/css-syntax/#consume-a-unicode-range-token
|
361
|
+
def consume_unicode_range; end
|
362
|
+
|
363
|
+
# Consumes a URL token and returns it. Assumes the original "url(" has
|
364
|
+
# already been consumed.
|
365
|
+
#
|
366
|
+
# 4.3.6. http://dev.w3.org/csswg/css-syntax/#consume-a-url-token
|
367
|
+
def consume_url; end
|
368
|
+
|
369
|
+
# Converts a valid CSS number string into a number and returns the number.
|
370
|
+
#
|
371
|
+
# 4.3.14. http://dev.w3.org/csswg/css-syntax/#convert-a-string-to-a-number
|
372
|
+
def convert_string_to_number(str); end
|
373
|
+
|
374
|
+
# Creates and returns a new token with the given _properties_.
|
375
|
+
def create_token(type, properties = T.unsafe(nil)); end
|
376
|
+
|
377
|
+
# Preprocesses _input_ to prepare it for the tokenizer.
|
378
|
+
#
|
379
|
+
# 3.3. http://dev.w3.org/csswg/css-syntax/#input-preprocessing
|
380
|
+
def preprocess(input); end
|
381
|
+
|
382
|
+
# Returns `true` if the given three-character _text_ would start an
|
383
|
+
# identifier. If _text_ is `nil`, the current and next two characters in the
|
384
|
+
# input stream will be checked, but will not be consumed.
|
385
|
+
#
|
386
|
+
# 4.3.10. http://dev.w3.org/csswg/css-syntax/#would-start-an-identifier
|
387
|
+
#
|
388
|
+
# @return [Boolean]
|
389
|
+
def start_identifier?(text = T.unsafe(nil)); end
|
390
|
+
|
391
|
+
# Returns `true` if the given three-character _text_ would start a number.
|
392
|
+
# If _text_ is `nil`, the current and next two characters in the input
|
393
|
+
# stream will be checked, but will not be consumed.
|
394
|
+
#
|
395
|
+
# 4.3.11. http://dev.w3.org/csswg/css-syntax/#starts-with-a-number
|
396
|
+
#
|
397
|
+
# @return [Boolean]
|
398
|
+
def start_number?(text = T.unsafe(nil)); end
|
399
|
+
|
400
|
+
# Tokenizes the input stream and returns an array of tokens.
|
401
|
+
def tokenize; end
|
402
|
+
|
403
|
+
# Returns `true` if the given two-character _text_ is the beginning of a
|
404
|
+
# valid escape sequence. If _text_ is `nil`, the current and next character
|
405
|
+
# in the input stream will be checked, but will not be consumed.
|
406
|
+
#
|
407
|
+
# 4.3.9. http://dev.w3.org/csswg/css-syntax/#starts-with-a-valid-escape
|
408
|
+
#
|
409
|
+
# @return [Boolean]
|
410
|
+
def valid_escape?(text = T.unsafe(nil)); end
|
411
|
+
|
412
|
+
class << self
|
413
|
+
# Tokenizes the given _input_ as a CSS string and returns an array of
|
414
|
+
# tokens.
|
415
|
+
#
|
416
|
+
# See {#initialize} for _options_.
|
417
|
+
def tokenize(input, options = T.unsafe(nil)); end
|
418
|
+
end
|
419
|
+
end
|
420
|
+
|
421
|
+
Crass::Tokenizer::RE_COMMENT_CLOSE = T.let(T.unsafe(nil), Regexp)
|
422
|
+
Crass::Tokenizer::RE_DIGIT = T.let(T.unsafe(nil), Regexp)
|
423
|
+
Crass::Tokenizer::RE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
424
|
+
Crass::Tokenizer::RE_HEX = T.let(T.unsafe(nil), Regexp)
|
425
|
+
Crass::Tokenizer::RE_NAME = T.let(T.unsafe(nil), Regexp)
|
426
|
+
Crass::Tokenizer::RE_NAME_START = T.let(T.unsafe(nil), Regexp)
|
427
|
+
Crass::Tokenizer::RE_NON_PRINTABLE = T.let(T.unsafe(nil), Regexp)
|
428
|
+
Crass::Tokenizer::RE_NUMBER_DECIMAL = T.let(T.unsafe(nil), Regexp)
|
429
|
+
Crass::Tokenizer::RE_NUMBER_EXPONENT = T.let(T.unsafe(nil), Regexp)
|
430
|
+
Crass::Tokenizer::RE_NUMBER_SIGN = T.let(T.unsafe(nil), Regexp)
|
431
|
+
Crass::Tokenizer::RE_NUMBER_STR = T.let(T.unsafe(nil), Regexp)
|
432
|
+
Crass::Tokenizer::RE_QUOTED_URL_START = T.let(T.unsafe(nil), Regexp)
|
433
|
+
Crass::Tokenizer::RE_UNICODE_RANGE_END = T.let(T.unsafe(nil), Regexp)
|
434
|
+
Crass::Tokenizer::RE_UNICODE_RANGE_START = T.let(T.unsafe(nil), Regexp)
|
435
|
+
Crass::Tokenizer::RE_WHITESPACE = T.let(T.unsafe(nil), Regexp)
|
436
|
+
Crass::Tokenizer::RE_WHITESPACE_ANCHORED = T.let(T.unsafe(nil), Regexp)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `danger-plugin-api` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem danger-plugin-api`.
|
6
|
+
|
7
|
+
# THIS IS AN EMPTY RBI FILE.
|
8
|
+
# see https://github.com/Shopify/tapioca/wiki/Manual-Gem-Requires
|