guardinari 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.
@@ -0,0 +1,494 @@
1
+ #ifndef yyHEADER_H
2
+ #define yyHEADER_H 1
3
+ #define yyIN_HEADER 1
4
+
5
+ #line 5 "scanner.h"
6
+
7
+ #line 7 "scanner.h"
8
+
9
+ #define YY_INT_ALIGNED short int
10
+
11
+ /* A lexical scanner generated by flex */
12
+
13
+ #define FLEX_SCANNER
14
+ #define YY_FLEX_MAJOR_VERSION 2
15
+ #define YY_FLEX_MINOR_VERSION 6
16
+ #define YY_FLEX_SUBMINOR_VERSION 4
17
+ #if YY_FLEX_SUBMINOR_VERSION > 0
18
+ #define FLEX_BETA
19
+ #endif
20
+
21
+ /* First, we deal with platform-specific or compiler-specific issues. */
22
+
23
+ /* begin standard C headers. */
24
+ #include <stdio.h>
25
+ #include <string.h>
26
+ #include <errno.h>
27
+ #include <stdlib.h>
28
+
29
+ /* end standard C headers. */
30
+
31
+ /* flex integer type definitions */
32
+
33
+ #ifndef FLEXINT_H
34
+ #define FLEXINT_H
35
+
36
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
37
+
38
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
39
+
40
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
41
+ * if you want the limit (max/min) macros for int types.
42
+ */
43
+ #ifndef __STDC_LIMIT_MACROS
44
+ #define __STDC_LIMIT_MACROS 1
45
+ #endif
46
+
47
+ #include <inttypes.h>
48
+ typedef int8_t flex_int8_t;
49
+ typedef uint8_t flex_uint8_t;
50
+ typedef int16_t flex_int16_t;
51
+ typedef uint16_t flex_uint16_t;
52
+ typedef int32_t flex_int32_t;
53
+ typedef uint32_t flex_uint32_t;
54
+ typedef uint64_t flex_uint64_t;
55
+ #else
56
+ typedef signed char flex_int8_t;
57
+ typedef short int flex_int16_t;
58
+ typedef int flex_int32_t;
59
+ typedef unsigned char flex_uint8_t;
60
+ typedef unsigned short int flex_uint16_t;
61
+ typedef unsigned int flex_uint32_t;
62
+
63
+ /* Limits of integral types. */
64
+ #ifndef INT8_MIN
65
+ #define INT8_MIN (-128)
66
+ #endif
67
+ #ifndef INT16_MIN
68
+ #define INT16_MIN (-32767-1)
69
+ #endif
70
+ #ifndef INT32_MIN
71
+ #define INT32_MIN (-2147483647-1)
72
+ #endif
73
+ #ifndef INT8_MAX
74
+ #define INT8_MAX (127)
75
+ #endif
76
+ #ifndef INT16_MAX
77
+ #define INT16_MAX (32767)
78
+ #endif
79
+ #ifndef INT32_MAX
80
+ #define INT32_MAX (2147483647)
81
+ #endif
82
+ #ifndef UINT8_MAX
83
+ #define UINT8_MAX (255U)
84
+ #endif
85
+ #ifndef UINT16_MAX
86
+ #define UINT16_MAX (65535U)
87
+ #endif
88
+ #ifndef UINT32_MAX
89
+ #define UINT32_MAX (4294967295U)
90
+ #endif
91
+
92
+ #ifndef SIZE_MAX
93
+ #define SIZE_MAX (~(size_t)0)
94
+ #endif
95
+
96
+ #endif /* ! C99 */
97
+
98
+ #endif /* ! FLEXINT_H */
99
+
100
+ /* begin standard C++ headers. */
101
+
102
+ /* TODO: this is always defined, so inline it */
103
+ #define yyconst const
104
+
105
+ #if defined(__GNUC__) && __GNUC__ >= 3
106
+ #define yynoreturn __attribute__((__noreturn__))
107
+ #else
108
+ #define yynoreturn
109
+ #endif
110
+
111
+ /* An opaque pointer. */
112
+ #ifndef YY_TYPEDEF_YY_SCANNER_T
113
+ #define YY_TYPEDEF_YY_SCANNER_T
114
+ typedef void* yyscan_t;
115
+ #endif
116
+
117
+ /* For convenience, these vars (plus the bison vars far below)
118
+ are macros in the reentrant scanner. */
119
+ #define yyin yyg->yyin_r
120
+ #define yyout yyg->yyout_r
121
+ #define yyextra yyg->yyextra_r
122
+ #define yyleng yyg->yyleng_r
123
+ #define yytext yyg->yytext_r
124
+ #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
125
+ #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
126
+ #define yy_flex_debug yyg->yy_flex_debug_r
127
+
128
+ /* Size of default input buffer. */
129
+ #ifndef YY_BUF_SIZE
130
+ #ifdef __ia64__
131
+ /* On IA-64, the buffer size is 16k, not 8k.
132
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
133
+ * Ditto for the __ia64__ case accordingly.
134
+ */
135
+ #define YY_BUF_SIZE 32768
136
+ #else
137
+ #define YY_BUF_SIZE 16384
138
+ #endif /* __ia64__ */
139
+ #endif
140
+
141
+ #ifndef YY_TYPEDEF_YY_BUFFER_STATE
142
+ #define YY_TYPEDEF_YY_BUFFER_STATE
143
+ typedef struct yy_buffer_state *YY_BUFFER_STATE;
144
+ #endif
145
+
146
+ #ifndef YY_TYPEDEF_YY_SIZE_T
147
+ #define YY_TYPEDEF_YY_SIZE_T
148
+ typedef size_t yy_size_t;
149
+ #endif
150
+
151
+ #ifndef YY_STRUCT_YY_BUFFER_STATE
152
+ #define YY_STRUCT_YY_BUFFER_STATE
153
+ struct yy_buffer_state
154
+ {
155
+ FILE *yy_input_file;
156
+
157
+ char *yy_ch_buf; /* input buffer */
158
+ char *yy_buf_pos; /* current position in input buffer */
159
+
160
+ /* Size of input buffer in bytes, not including room for EOB
161
+ * characters.
162
+ */
163
+ int yy_buf_size;
164
+
165
+ /* Number of characters read into yy_ch_buf, not including EOB
166
+ * characters.
167
+ */
168
+ yy_size_t yy_n_chars;
169
+
170
+ /* Whether we "own" the buffer - i.e., we know we created it,
171
+ * and can realloc() it to grow it, and should free() it to
172
+ * delete it.
173
+ */
174
+ int yy_is_our_buffer;
175
+
176
+ /* Whether this is an "interactive" input source; if so, and
177
+ * if we're using stdio for input, then we want to use getc()
178
+ * instead of fread(), to make sure we stop fetching input after
179
+ * each newline.
180
+ */
181
+ int yy_is_interactive;
182
+
183
+ /* Whether we're considered to be at the beginning of a line.
184
+ * If so, '^' rules will be active on the next match, otherwise
185
+ * not.
186
+ */
187
+ int yy_at_bol;
188
+
189
+ int yy_bs_lineno; /**< The line count. */
190
+ int yy_bs_column; /**< The column count. */
191
+
192
+ /* Whether to try to fill the input buffer when we reach the
193
+ * end of it.
194
+ */
195
+ int yy_fill_buffer;
196
+
197
+ int yy_buffer_status;
198
+
199
+ };
200
+ #endif /* !YY_STRUCT_YY_BUFFER_STATE */
201
+
202
+ void yyrestart ( FILE *input_file , yyscan_t yyscanner );
203
+ void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
204
+ YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
205
+ void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
206
+ void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
207
+ void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
208
+ void yypop_buffer_state ( yyscan_t yyscanner );
209
+
210
+ YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
211
+ YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
212
+ YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len , yyscan_t yyscanner );
213
+
214
+ void *yyalloc ( yy_size_t , yyscan_t yyscanner );
215
+ void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
216
+ void yyfree ( void * , yyscan_t yyscanner );
217
+
218
+ /* Begin user sect3 */
219
+
220
+ #define yywrap(yyscanner) (/*CONSTCOND*/1)
221
+ #define YY_SKIP_YYWRAP
222
+
223
+ #define yytext_ptr yytext_r
224
+
225
+ #ifdef YY_HEADER_EXPORT_START_CONDITIONS
226
+ #define INITIAL 0
227
+ #define COMMENT 1
228
+
229
+ #endif
230
+
231
+ #ifndef YY_NO_UNISTD_H
232
+ /* Special case for "unistd.h", since it is non-ANSI. We include it way
233
+ * down here because we want the user's section 1 to have been scanned first.
234
+ * The user has a chance to override it with an option.
235
+ */
236
+ #include <unistd.h>
237
+ #endif
238
+
239
+ #ifndef YY_EXTRA_TYPE
240
+ #define YY_EXTRA_TYPE void *
241
+ #endif
242
+
243
+ int yylex_init (yyscan_t* scanner);
244
+
245
+ int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
246
+
247
+ /* Accessor methods to globals.
248
+ These are made visible to non-reentrant scanners for convenience. */
249
+
250
+ int yylex_destroy ( yyscan_t yyscanner );
251
+
252
+ int yyget_debug ( yyscan_t yyscanner );
253
+
254
+ void yyset_debug ( int debug_flag , yyscan_t yyscanner );
255
+
256
+ YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
257
+
258
+ void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
259
+
260
+ FILE *yyget_in ( yyscan_t yyscanner );
261
+
262
+ void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
263
+
264
+ FILE *yyget_out ( yyscan_t yyscanner );
265
+
266
+ void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
267
+
268
+ yy_size_t yyget_leng ( yyscan_t yyscanner );
269
+
270
+ char *yyget_text ( yyscan_t yyscanner );
271
+
272
+ int yyget_lineno ( yyscan_t yyscanner );
273
+
274
+ void yyset_lineno ( int _line_number , yyscan_t yyscanner );
275
+
276
+ int yyget_column ( yyscan_t yyscanner );
277
+
278
+ void yyset_column ( int _column_no , yyscan_t yyscanner );
279
+
280
+ /* Macros after this point can all be overridden by user definitions in
281
+ * section 1.
282
+ */
283
+
284
+ #ifndef YY_SKIP_YYWRAP
285
+ #ifdef __cplusplus
286
+ extern "C" int yywrap ( yyscan_t yyscanner );
287
+ #else
288
+ extern int yywrap ( yyscan_t yyscanner );
289
+ #endif
290
+ #endif
291
+
292
+ #ifndef yytext_ptr
293
+ static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
294
+ #endif
295
+
296
+ #ifdef YY_NEED_STRLEN
297
+ static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
298
+ #endif
299
+
300
+ #ifndef YY_NO_INPUT
301
+
302
+ #endif
303
+
304
+ /* Amount of stuff to slurp up with each read. */
305
+ #ifndef YY_READ_BUF_SIZE
306
+ #ifdef __ia64__
307
+ /* On IA-64, the buffer size is 16k, not 8k */
308
+ #define YY_READ_BUF_SIZE 16384
309
+ #else
310
+ #define YY_READ_BUF_SIZE 8192
311
+ #endif /* __ia64__ */
312
+ #endif
313
+
314
+ /* Number of entries by which start-condition stack grows. */
315
+ #ifndef YY_START_STACK_INCR
316
+ #define YY_START_STACK_INCR 25
317
+ #endif
318
+
319
+ /* Default declaration of generated scanner - a define so the user can
320
+ * easily add parameters.
321
+ */
322
+ #ifndef YY_DECL
323
+ #define YY_DECL_IS_OURS 1
324
+
325
+ extern int yylex (yyscan_t yyscanner);
326
+
327
+ #define YY_DECL int yylex (yyscan_t yyscanner)
328
+ #endif /* !YY_DECL */
329
+
330
+ /* yy_get_previous_state - get the state just before the EOB char was reached */
331
+
332
+ #undef YY_NEW_FILE
333
+ #undef YY_FLUSH_BUFFER
334
+ #undef yy_set_bol
335
+ #undef yy_new_buffer
336
+ #undef yy_set_interactive
337
+ #undef YY_DO_BEFORE_ACTION
338
+
339
+ #ifdef YY_DECL_IS_OURS
340
+ #undef YY_DECL_IS_OURS
341
+ #undef YY_DECL
342
+ #endif
343
+
344
+ #ifndef yy_create_buffer_ALREADY_DEFINED
345
+ #undef yy_create_buffer
346
+ #endif
347
+ #ifndef yy_delete_buffer_ALREADY_DEFINED
348
+ #undef yy_delete_buffer
349
+ #endif
350
+ #ifndef yy_scan_buffer_ALREADY_DEFINED
351
+ #undef yy_scan_buffer
352
+ #endif
353
+ #ifndef yy_scan_string_ALREADY_DEFINED
354
+ #undef yy_scan_string
355
+ #endif
356
+ #ifndef yy_scan_bytes_ALREADY_DEFINED
357
+ #undef yy_scan_bytes
358
+ #endif
359
+ #ifndef yy_init_buffer_ALREADY_DEFINED
360
+ #undef yy_init_buffer
361
+ #endif
362
+ #ifndef yy_flush_buffer_ALREADY_DEFINED
363
+ #undef yy_flush_buffer
364
+ #endif
365
+ #ifndef yy_load_buffer_state_ALREADY_DEFINED
366
+ #undef yy_load_buffer_state
367
+ #endif
368
+ #ifndef yy_switch_to_buffer_ALREADY_DEFINED
369
+ #undef yy_switch_to_buffer
370
+ #endif
371
+ #ifndef yypush_buffer_state_ALREADY_DEFINED
372
+ #undef yypush_buffer_state
373
+ #endif
374
+ #ifndef yypop_buffer_state_ALREADY_DEFINED
375
+ #undef yypop_buffer_state
376
+ #endif
377
+ #ifndef yyensure_buffer_stack_ALREADY_DEFINED
378
+ #undef yyensure_buffer_stack
379
+ #endif
380
+ #ifndef yylex_ALREADY_DEFINED
381
+ #undef yylex
382
+ #endif
383
+ #ifndef yyrestart_ALREADY_DEFINED
384
+ #undef yyrestart
385
+ #endif
386
+ #ifndef yylex_init_ALREADY_DEFINED
387
+ #undef yylex_init
388
+ #endif
389
+ #ifndef yylex_init_extra_ALREADY_DEFINED
390
+ #undef yylex_init_extra
391
+ #endif
392
+ #ifndef yylex_destroy_ALREADY_DEFINED
393
+ #undef yylex_destroy
394
+ #endif
395
+ #ifndef yyget_debug_ALREADY_DEFINED
396
+ #undef yyget_debug
397
+ #endif
398
+ #ifndef yyset_debug_ALREADY_DEFINED
399
+ #undef yyset_debug
400
+ #endif
401
+ #ifndef yyget_extra_ALREADY_DEFINED
402
+ #undef yyget_extra
403
+ #endif
404
+ #ifndef yyset_extra_ALREADY_DEFINED
405
+ #undef yyset_extra
406
+ #endif
407
+ #ifndef yyget_in_ALREADY_DEFINED
408
+ #undef yyget_in
409
+ #endif
410
+ #ifndef yyset_in_ALREADY_DEFINED
411
+ #undef yyset_in
412
+ #endif
413
+ #ifndef yyget_out_ALREADY_DEFINED
414
+ #undef yyget_out
415
+ #endif
416
+ #ifndef yyset_out_ALREADY_DEFINED
417
+ #undef yyset_out
418
+ #endif
419
+ #ifndef yyget_leng_ALREADY_DEFINED
420
+ #undef yyget_leng
421
+ #endif
422
+ #ifndef yyget_text_ALREADY_DEFINED
423
+ #undef yyget_text
424
+ #endif
425
+ #ifndef yyget_lineno_ALREADY_DEFINED
426
+ #undef yyget_lineno
427
+ #endif
428
+ #ifndef yyset_lineno_ALREADY_DEFINED
429
+ #undef yyset_lineno
430
+ #endif
431
+ #ifndef yyget_column_ALREADY_DEFINED
432
+ #undef yyget_column
433
+ #endif
434
+ #ifndef yyset_column_ALREADY_DEFINED
435
+ #undef yyset_column
436
+ #endif
437
+ #ifndef yywrap_ALREADY_DEFINED
438
+ #undef yywrap
439
+ #endif
440
+ #ifndef yyget_lval_ALREADY_DEFINED
441
+ #undef yyget_lval
442
+ #endif
443
+ #ifndef yyset_lval_ALREADY_DEFINED
444
+ #undef yyset_lval
445
+ #endif
446
+ #ifndef yyget_lloc_ALREADY_DEFINED
447
+ #undef yyget_lloc
448
+ #endif
449
+ #ifndef yyset_lloc_ALREADY_DEFINED
450
+ #undef yyset_lloc
451
+ #endif
452
+ #ifndef yyalloc_ALREADY_DEFINED
453
+ #undef yyalloc
454
+ #endif
455
+ #ifndef yyrealloc_ALREADY_DEFINED
456
+ #undef yyrealloc
457
+ #endif
458
+ #ifndef yyfree_ALREADY_DEFINED
459
+ #undef yyfree
460
+ #endif
461
+ #ifndef yytext_ALREADY_DEFINED
462
+ #undef yytext
463
+ #endif
464
+ #ifndef yyleng_ALREADY_DEFINED
465
+ #undef yyleng
466
+ #endif
467
+ #ifndef yyin_ALREADY_DEFINED
468
+ #undef yyin
469
+ #endif
470
+ #ifndef yyout_ALREADY_DEFINED
471
+ #undef yyout
472
+ #endif
473
+ #ifndef yy_flex_debug_ALREADY_DEFINED
474
+ #undef yy_flex_debug
475
+ #endif
476
+ #ifndef yylineno_ALREADY_DEFINED
477
+ #undef yylineno
478
+ #endif
479
+ #ifndef yytables_fload_ALREADY_DEFINED
480
+ #undef yytables_fload
481
+ #endif
482
+ #ifndef yytables_destroy_ALREADY_DEFINED
483
+ #undef yytables_destroy
484
+ #endif
485
+ #ifndef yyTABLES_NAME_ALREADY_DEFINED
486
+ #undef yyTABLES_NAME
487
+ #endif
488
+
489
+ #line 138 "guardinari.l"
490
+
491
+
492
+ #line 492 "scanner.h"
493
+ #undef yyIN_HEADER
494
+ #endif /* yyHEADER_H */
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Guardinari
4
+ VERSION = "0.1.0"
5
+ end
data/lib/guardinari.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "guardinari/version"
4
+
5
+ module Guardinari
6
+ # Guts implemented in C extension
7
+ end
8
+
9
+ require_relative "guardinari/guardinari"
@@ -0,0 +1,4 @@
1
+ module Guardinari
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guardinari
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Matthew Eagar
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2026-02-02 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Find badly paginated queries containg a LIMIT and OFFSET but not ORDER
14
+ BY
15
+ email:
16
+ - meagar@gmail.com
17
+ executables: []
18
+ extensions:
19
+ - ext/guardinari/extconf.rb
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".rubocop.yml"
23
+ - LICENSE.txt
24
+ - README.md
25
+ - Rakefile
26
+ - ext/guardinari/Makefile
27
+ - ext/guardinari/depend
28
+ - ext/guardinari/extconf.rb
29
+ - ext/guardinari/guardinari.c
30
+ - ext/guardinari/guardinari.l
31
+ - ext/guardinari/scanner.h
32
+ - lib/guardinari.rb
33
+ - lib/guardinari/version.rb
34
+ - sig/pagination_checker.rbs
35
+ homepage: https://www.codeberg.org/meagar/guardinari
36
+ licenses:
37
+ - MIT
38
+ metadata:
39
+ homepage_uri: https://www.codeberg.org/meagar/guardinari
40
+ source_code_uri: https://codeberg.org/meagar/guardinari
41
+ rubygems_mfa_required: 'true'
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 3.0.0
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubygems_version: 3.5.22
58
+ signing_key:
59
+ specification_version: 4
60
+ summary: Find badly paginated queries containg a LIMIT and OFFSET but not ORDER BY
61
+ test_files: []