lunchmoney 1.2.0 → 1.4.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/.github/workflows/build_and_publish_yard_docs.yml +1 -1
- data/.github/workflows/check_pipeline.yml +2 -2
- data/.github/workflows/ci.yml +1 -1
- data/.github/workflows/{dependabot-rbi-updater.yml → rbi-updater.yml} +2 -3
- data/.simplecov +1 -2
- data/Gemfile +2 -3
- data/Gemfile.lock +70 -75
- data/lib/lunchmoney/objects/transaction.rb +9 -1
- data/lib/lunchmoney/objects/user.rb +4 -1
- data/lib/lunchmoney/version.rb +1 -1
- data/sorbet/rbi/annotations/activesupport.rbi +31 -0
- data/sorbet/rbi/annotations/minitest.rbi +119 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +1 -0
- data/sorbet/rbi/gems/{activesupport@7.1.3.2.rbi → activesupport@7.2.1.rbi} +1345 -1253
- data/sorbet/rbi/gems/{addressable@2.8.6.rbi → addressable@2.8.7.rbi} +2 -1
- data/sorbet/rbi/gems/{bigdecimal@3.1.7.rbi → bigdecimal@3.1.8.rbi} +1 -0
- data/sorbet/rbi/gems/{chef-utils@18.4.2.rbi → chef-utils@18.5.0.rbi} +1 -0
- data/sorbet/rbi/gems/{concurrent-ruby@1.2.3.rbi → concurrent-ruby@1.3.4.rbi} +64 -9
- data/sorbet/rbi/gems/{docile@1.4.0.rbi → docile@1.4.1.rbi} +1 -0
- data/sorbet/rbi/gems/{dotenv@3.1.0.rbi → dotenv@3.1.2.rbi} +20 -17
- data/sorbet/rbi/gems/{erubi@1.12.0.rbi → erubi@1.13.0.rbi} +20 -15
- data/sorbet/rbi/gems/{faraday-net_http@3.1.0.rbi → faraday-net_http@3.1.1.rbi} +36 -35
- data/sorbet/rbi/gems/{faraday@2.9.0.rbi → faraday@2.10.1.rbi} +79 -33
- data/sorbet/rbi/gems/{hashdiff@1.1.0.rbi → hashdiff@1.1.1.rbi} +3 -2
- data/sorbet/rbi/gems/{i18n@1.14.4.rbi → i18n@1.14.5.rbi} +43 -14
- data/sorbet/rbi/gems/{json@2.7.1.rbi → json@2.7.2.rbi} +72 -72
- data/sorbet/rbi/gems/logger@1.6.0.rbi +903 -0
- data/sorbet/rbi/gems/{minitest@5.22.3.rbi → minitest@5.25.1.rbi} +245 -235
- data/sorbet/rbi/gems/{mixlib-shellout@3.2.7.rbi → mixlib-shellout@3.2.8.rbi} +1 -0
- data/sorbet/rbi/gems/{mocha@2.1.0.rbi → mocha@2.4.5.rbi} +169 -144
- data/sorbet/rbi/gems/{parallel@1.24.0.rbi → parallel@1.26.3.rbi} +32 -21
- data/sorbet/rbi/gems/{parser@3.3.0.5.rbi → parser@3.3.4.2.rbi} +233 -186
- data/sorbet/rbi/gems/{prism@0.24.0.rbi → prism@0.30.0.rbi} +20933 -12761
- data/sorbet/rbi/gems/{public_suffix@5.0.4.rbi → public_suffix@6.0.1.rbi} +1 -0
- data/sorbet/rbi/gems/{racc@1.7.3.rbi → racc@1.8.1.rbi} +34 -33
- data/sorbet/rbi/gems/{rack@3.0.10.rbi → rack@3.1.7.rbi} +694 -987
- data/sorbet/rbi/gems/{rake@13.1.0.rbi → rake@13.2.1.rbi} +56 -55
- data/sorbet/rbi/gems/{rbi@0.1.9.rbi → rbi@0.1.14.rbi} +904 -622
- data/sorbet/rbi/gems/{regexp_parser@2.9.0.rbi → regexp_parser@2.9.2.rbi} +3 -2
- data/sorbet/rbi/gems/{rexml@3.2.6.rbi → rexml@3.3.6.rbi} +383 -245
- data/sorbet/rbi/gems/{rubocop-ast@1.31.2.rbi → rubocop-ast@1.32.1.rbi} +393 -349
- data/sorbet/rbi/gems/{rubocop-minitest@0.35.0.rbi → rubocop-minitest@0.35.1.rbi} +11 -8
- data/sorbet/rbi/gems/{rubocop-rails@2.24.1.rbi → rubocop-rails@2.26.0.rbi} +604 -275
- data/sorbet/rbi/gems/{rubocop-sorbet@0.8.0.rbi → rubocop-sorbet@0.8.5.rbi} +253 -127
- data/sorbet/rbi/gems/{rubocop@1.62.1.rbi → rubocop@1.65.1.rbi} +2334 -1779
- data/sorbet/rbi/gems/securerandom@0.3.1.rbi +73 -0
- data/sorbet/rbi/gems/{spoom@1.2.4.rbi → spoom@1.4.2.rbi} +2003 -848
- data/sorbet/rbi/gems/strscan@3.1.0.rbi +9 -0
- data/sorbet/rbi/gems/{tapioca@0.13.1.rbi → tapioca@0.16.1.rbi} +294 -259
- data/sorbet/rbi/gems/{toys-core@0.15.5.rbi → toys-core@0.15.6.rbi} +1 -0
- data/sorbet/rbi/gems/{toys@0.15.5.rbi → toys@0.15.6.rbi} +4 -3
- data/sorbet/rbi/gems/{vcr@6.2.0.rbi → vcr@6.3.1.rbi} +72 -68
- data/sorbet/rbi/gems/{webmock@3.23.0.rbi → webmock@3.23.1.rbi} +1 -0
- data/sorbet/rbi/gems/{yard-sorbet@0.8.1.rbi → yard-sorbet@0.9.0.rbi} +36 -29
- metadata +46 -49
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -3426
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -272
- data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +0 -93
- data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +0 -951
- data/sorbet/rbi/gems/pry-sorbet@0.2.1.rbi +0 -966
- data/sorbet/rbi/gems/pry@0.14.2.rbi +0 -10077
- data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +0 -23136
@@ -4,6 +4,7 @@
|
|
4
4
|
# This is an autogenerated file for types exported from the `rubocop-rails` gem.
|
5
5
|
# Please instead update this file by running `bin/tapioca gem rubocop-rails`.
|
6
6
|
|
7
|
+
|
7
8
|
# source://rubocop-rails//lib/rubocop/rails.rb#3
|
8
9
|
module RuboCop; end
|
9
10
|
|
@@ -1457,71 +1458,71 @@ RuboCop::Cop::Rails::Blank::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
|
1457
1458
|
class RuboCop::Cop::Rails::BulkChangeTable < ::RuboCop::Cop::Base
|
1458
1459
|
include ::RuboCop::Cop::DatabaseTypeResolvable
|
1459
1460
|
|
1460
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1461
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#121
|
1461
1462
|
def on_def(node); end
|
1462
1463
|
|
1463
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1464
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#139
|
1464
1465
|
def on_send(node); end
|
1465
1466
|
|
1466
1467
|
private
|
1467
1468
|
|
1468
1469
|
# @param node [RuboCop::AST::SendNode]
|
1469
1470
|
#
|
1470
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1471
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#219
|
1471
1472
|
def add_offense_for_alter_methods(node); end
|
1472
1473
|
|
1473
1474
|
# @param node [RuboCop::AST::SendNode]
|
1474
1475
|
#
|
1475
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1476
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#229
|
1476
1477
|
def add_offense_for_change_table(node); end
|
1477
1478
|
|
1478
1479
|
# @return [Boolean]
|
1479
1480
|
#
|
1480
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1481
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#192
|
1481
1482
|
def call_to_combinable_alter_method?(child_node); end
|
1482
1483
|
|
1483
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1484
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#196
|
1484
1485
|
def combinable_alter_methods; end
|
1485
1486
|
|
1486
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1487
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#207
|
1487
1488
|
def combinable_transformations; end
|
1488
1489
|
|
1489
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1490
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#160
|
1490
1491
|
def count_transformations(send_nodes); end
|
1491
1492
|
|
1492
1493
|
# @param node [RuboCop::AST::SendNode] (send nil? :change_table ...)
|
1493
1494
|
# @return [Boolean]
|
1494
1495
|
#
|
1495
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1496
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#171
|
1496
1497
|
def include_bulk_options?(node); end
|
1497
1498
|
|
1498
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1499
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#152
|
1499
1500
|
def send_nodes_from_change_table_block(body); end
|
1500
1501
|
|
1501
1502
|
# @return [Boolean]
|
1502
1503
|
#
|
1503
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1504
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#179
|
1504
1505
|
def support_bulk_alter?; end
|
1505
1506
|
end
|
1506
1507
|
|
1507
1508
|
# Record combinable alter methods and register offensive nodes.
|
1508
1509
|
#
|
1509
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1510
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#234
|
1510
1511
|
class RuboCop::Cop::Rails::BulkChangeTable::AlterMethodsRecorder
|
1511
1512
|
# @return [AlterMethodsRecorder] a new instance of AlterMethodsRecorder
|
1512
1513
|
#
|
1513
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1514
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#235
|
1514
1515
|
def initialize; end
|
1515
1516
|
|
1516
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1517
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#254
|
1517
1518
|
def flush; end
|
1518
1519
|
|
1519
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1520
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#259
|
1520
1521
|
def offensive_nodes; end
|
1521
1522
|
|
1522
1523
|
# @param new_node [RuboCop::AST::SendNode]
|
1523
1524
|
#
|
1524
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1525
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#241
|
1525
1526
|
def process(new_node); end
|
1526
1527
|
end
|
1527
1528
|
|
@@ -1546,12 +1547,18 @@ RuboCop::Cop::Rails::BulkChangeTable::MYSQL_COMBINABLE_ALTER_METHODS = T.let(T.u
|
|
1546
1547
|
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#111
|
1547
1548
|
RuboCop::Cop::Rails::BulkChangeTable::MYSQL_COMBINABLE_TRANSFORMATIONS = T.let(T.unsafe(nil), Array)
|
1548
1549
|
|
1549
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#
|
1550
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#118
|
1550
1551
|
RuboCop::Cop::Rails::BulkChangeTable::POSTGRESQL_COMBINABLE_ALTER_METHODS = T.let(T.unsafe(nil), Array)
|
1551
1552
|
|
1553
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#119
|
1554
|
+
RuboCop::Cop::Rails::BulkChangeTable::POSTGRESQL_COMBINABLE_ALTER_METHODS_SINCE_6_1 = T.let(T.unsafe(nil), Array)
|
1555
|
+
|
1552
1556
|
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#115
|
1553
1557
|
RuboCop::Cop::Rails::BulkChangeTable::POSTGRESQL_COMBINABLE_TRANSFORMATIONS = T.let(T.unsafe(nil), Array)
|
1554
1558
|
|
1559
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/bulk_change_table.rb#116
|
1560
|
+
RuboCop::Cop::Rails::BulkChangeTable::POSTGRESQL_COMBINABLE_TRANSFORMATIONS_SINCE_6_1 = T.let(T.unsafe(nil), Array)
|
1561
|
+
|
1555
1562
|
# Checks if collection can be blank-compacted with `compact_blank`.
|
1556
1563
|
#
|
1557
1564
|
# @example
|
@@ -1559,6 +1566,8 @@ RuboCop::Cop::Rails::BulkChangeTable::POSTGRESQL_COMBINABLE_TRANSFORMATIONS = T.
|
|
1559
1566
|
# # bad
|
1560
1567
|
# collection.reject(&:blank?)
|
1561
1568
|
# collection.reject { |_k, v| v.blank? }
|
1569
|
+
# collection.select(&:present?)
|
1570
|
+
# collection.select { |_k, v| v.present? }
|
1562
1571
|
#
|
1563
1572
|
# # good
|
1564
1573
|
# collection.compact_blank
|
@@ -1566,55 +1575,61 @@ RuboCop::Cop::Rails::BulkChangeTable::POSTGRESQL_COMBINABLE_TRANSFORMATIONS = T.
|
|
1566
1575
|
# # bad
|
1567
1576
|
# collection.delete_if(&:blank?) # Same behavior as `Array#compact_blank!` and `Hash#compact_blank!`
|
1568
1577
|
# collection.delete_if { |_k, v| v.blank? } # Same behavior as `Array#compact_blank!` and `Hash#compact_blank!`
|
1569
|
-
# collection.
|
1570
|
-
# collection.
|
1578
|
+
# collection.keep_if(&:present?) # Same behavior as `Array#compact_blank!` and `Hash#compact_blank!`
|
1579
|
+
# collection.keep_if { |_k, v| v.present? } # Same behavior as `Array#compact_blank!` and `Hash#compact_blank!`
|
1571
1580
|
#
|
1572
1581
|
# # good
|
1573
1582
|
# collection.compact_blank!
|
1574
1583
|
#
|
1575
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1584
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#41
|
1576
1585
|
class RuboCop::Cop::Rails::CompactBlank < ::RuboCop::Cop::Base
|
1577
1586
|
include ::RuboCop::Cop::RangeHelp
|
1578
1587
|
extend ::RuboCop::Cop::AutoCorrector
|
1579
1588
|
extend ::RuboCop::Cop::TargetRailsVersion
|
1580
1589
|
|
1581
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1590
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#79
|
1582
1591
|
def on_send(node); end
|
1583
1592
|
|
1584
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1593
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#51
|
1585
1594
|
def reject_with_block?(param0 = T.unsafe(nil)); end
|
1586
1595
|
|
1587
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1596
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#59
|
1588
1597
|
def reject_with_block_pass?(param0 = T.unsafe(nil)); end
|
1589
1598
|
|
1599
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#65
|
1600
|
+
def select_with_block?(param0 = T.unsafe(nil)); end
|
1601
|
+
|
1602
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#73
|
1603
|
+
def select_with_block_pass?(param0 = T.unsafe(nil)); end
|
1604
|
+
|
1590
1605
|
private
|
1591
1606
|
|
1592
1607
|
# @return [Boolean]
|
1593
1608
|
#
|
1594
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1609
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#91
|
1595
1610
|
def bad_method?(node); end
|
1596
1611
|
|
1597
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1612
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#112
|
1598
1613
|
def offense_range(node); end
|
1599
1614
|
|
1600
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1615
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#122
|
1601
1616
|
def preferred_method(node); end
|
1602
1617
|
|
1603
1618
|
# @return [Boolean]
|
1604
1619
|
#
|
1605
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1620
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#108
|
1606
1621
|
def use_hash_value_block_argument?(arguments, receiver_in_block); end
|
1607
1622
|
|
1608
1623
|
# @return [Boolean]
|
1609
1624
|
#
|
1610
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1625
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#104
|
1611
1626
|
def use_single_value_block_argument?(arguments, receiver_in_block); end
|
1612
1627
|
end
|
1613
1628
|
|
1614
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1629
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#46
|
1615
1630
|
RuboCop::Cop::Rails::CompactBlank::MSG = T.let(T.unsafe(nil), String)
|
1616
1631
|
|
1617
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#
|
1632
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/compact_blank.rb#47
|
1618
1633
|
RuboCop::Cop::Rails::CompactBlank::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1619
1634
|
|
1620
1635
|
# Checks legacy syntax usage of `tag`
|
@@ -1812,10 +1827,10 @@ RuboCop::Cop::Rails::DangerousColumnNames::RESTRICT_ON_SEND = T.let(T.unsafe(nil
|
|
1812
1827
|
# The cop also reports warnings when you are using `to_time` method,
|
1813
1828
|
# because it doesn't know about Rails time zone either.
|
1814
1829
|
#
|
1815
|
-
# Two styles are supported for this cop. When `EnforcedStyle` is
|
1830
|
+
# Two styles are supported for this cop. When `EnforcedStyle` is `strict`
|
1816
1831
|
# then the Date methods `today`, `current`, `yesterday`, and `tomorrow`
|
1817
1832
|
# are prohibited and the usage of both `to_time`
|
1818
|
-
# and
|
1833
|
+
# and `to_time_in_current_zone` are reported as warning.
|
1819
1834
|
#
|
1820
1835
|
# When `EnforcedStyle` is `flexible` then only `Date.today` is prohibited.
|
1821
1836
|
#
|
@@ -2580,43 +2595,140 @@ RuboCop::Cop::Rails::EagerEvaluationLogMessage::RESTRICT_ON_SEND = T.let(T.unsaf
|
|
2580
2595
|
#
|
2581
2596
|
# @example
|
2582
2597
|
# # bad
|
2598
|
+
# enum :status, [:active, :archived]
|
2599
|
+
#
|
2600
|
+
# # good
|
2601
|
+
# enum :status, { active: 0, archived: 1 }
|
2602
|
+
#
|
2603
|
+
# # bad
|
2583
2604
|
# enum status: [:active, :archived]
|
2584
2605
|
#
|
2585
2606
|
# # good
|
2586
2607
|
# enum status: { active: 0, archived: 1 }
|
2587
2608
|
#
|
2588
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#
|
2609
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#26
|
2589
2610
|
class RuboCop::Cop::Rails::EnumHash < ::RuboCop::Cop::Base
|
2590
2611
|
extend ::RuboCop::Cop::AutoCorrector
|
2591
2612
|
|
2592
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#
|
2613
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#40
|
2593
2614
|
def array_pair?(param0 = T.unsafe(nil)); end
|
2594
2615
|
|
2595
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#
|
2596
|
-
def
|
2616
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#32
|
2617
|
+
def enum_with_array?(param0 = T.unsafe(nil)); end
|
2618
|
+
|
2619
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#36
|
2620
|
+
def enum_with_old_syntax?(param0 = T.unsafe(nil)); end
|
2597
2621
|
|
2598
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#
|
2622
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#44
|
2599
2623
|
def on_send(node); end
|
2600
2624
|
|
2601
2625
|
private
|
2602
2626
|
|
2603
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#
|
2627
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#89
|
2628
|
+
def build_hash(array); end
|
2629
|
+
|
2630
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#69
|
2604
2631
|
def enum_name(key); end
|
2605
2632
|
|
2606
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#
|
2633
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#65
|
2634
|
+
def message(key); end
|
2635
|
+
|
2636
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#78
|
2607
2637
|
def source(elem); end
|
2608
2638
|
end
|
2609
2639
|
|
2610
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#
|
2640
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#29
|
2611
2641
|
RuboCop::Cop::Rails::EnumHash::MSG = T.let(T.unsafe(nil), String)
|
2612
2642
|
|
2613
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#
|
2643
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_hash.rb#30
|
2614
2644
|
RuboCop::Cop::Rails::EnumHash::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2615
2645
|
|
2646
|
+
# Looks for enums written with keyword arguments syntax.
|
2647
|
+
#
|
2648
|
+
# Defining enums with keyword arguments syntax is deprecated and will be removed in Rails 8.0.
|
2649
|
+
# Positional arguments should be used instead:
|
2650
|
+
#
|
2651
|
+
# @example
|
2652
|
+
# # bad
|
2653
|
+
# enum status: { active: 0, archived: 1 }, _prefix: true
|
2654
|
+
#
|
2655
|
+
# # good
|
2656
|
+
# enum :status, { active: 0, archived: 1 }, prefix: true
|
2657
|
+
#
|
2658
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#18
|
2659
|
+
class RuboCop::Cop::Rails::EnumSyntax < ::RuboCop::Cop::Base
|
2660
|
+
extend ::RuboCop::Cop::AutoCorrector
|
2661
|
+
extend ::RuboCop::Cop::TargetRailsVersion
|
2662
|
+
|
2663
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#29
|
2664
|
+
def enum?(param0 = T.unsafe(nil)); end
|
2665
|
+
|
2666
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#41
|
2667
|
+
def enum_options(param0 = T.unsafe(nil)); end
|
2668
|
+
|
2669
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#37
|
2670
|
+
def enum_values(param0 = T.unsafe(nil)); end
|
2671
|
+
|
2672
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#33
|
2673
|
+
def enum_with_options?(param0 = T.unsafe(nil)); end
|
2674
|
+
|
2675
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#45
|
2676
|
+
def on_send(node); end
|
2677
|
+
|
2678
|
+
private
|
2679
|
+
|
2680
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#52
|
2681
|
+
def check_and_correct_keyword_args(node); end
|
2682
|
+
|
2683
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#63
|
2684
|
+
def check_enum_options(node); end
|
2685
|
+
|
2686
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#73
|
2687
|
+
def correct_keyword_args(node, key, values, options); end
|
2688
|
+
|
2689
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#110
|
2690
|
+
def correct_options(options); end
|
2691
|
+
|
2692
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#99
|
2693
|
+
def enum_name(elem); end
|
2694
|
+
|
2695
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#90
|
2696
|
+
def enum_name_value(key); end
|
2697
|
+
|
2698
|
+
# @return [Boolean]
|
2699
|
+
#
|
2700
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#84
|
2701
|
+
def multiple_enum_definitions?(node); end
|
2702
|
+
end
|
2703
|
+
|
2704
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#24
|
2705
|
+
RuboCop::Cop::Rails::EnumSyntax::MSG = T.let(T.unsafe(nil), String)
|
2706
|
+
|
2707
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#25
|
2708
|
+
RuboCop::Cop::Rails::EnumSyntax::MSG_OPTIONS = T.let(T.unsafe(nil), String)
|
2709
|
+
|
2710
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#27
|
2711
|
+
RuboCop::Cop::Rails::EnumSyntax::OPTION_NAMES = T.let(T.unsafe(nil), Array)
|
2712
|
+
|
2713
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_syntax.rb#26
|
2714
|
+
RuboCop::Cop::Rails::EnumSyntax::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2715
|
+
|
2616
2716
|
# Looks for duplicate values in enum declarations.
|
2617
2717
|
#
|
2618
2718
|
# @example
|
2619
2719
|
# # bad
|
2720
|
+
# enum :status, { active: 0, archived: 0 }
|
2721
|
+
#
|
2722
|
+
# # good
|
2723
|
+
# enum :status, { active: 0, archived: 1 }
|
2724
|
+
#
|
2725
|
+
# # bad
|
2726
|
+
# enum :status, [:active, :archived, :active]
|
2727
|
+
#
|
2728
|
+
# # good
|
2729
|
+
# enum :status, [:active, :archived]
|
2730
|
+
#
|
2731
|
+
# # bad
|
2620
2732
|
# enum status: { active: 0, archived: 0 }
|
2621
2733
|
#
|
2622
2734
|
# # good
|
@@ -2628,29 +2740,35 @@ RuboCop::Cop::Rails::EnumHash::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
|
2628
2740
|
# # good
|
2629
2741
|
# enum status: [:active, :archived]
|
2630
2742
|
#
|
2631
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#
|
2743
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#32
|
2632
2744
|
class RuboCop::Cop::Rails::EnumUniqueness < ::RuboCop::Cop::Base
|
2633
2745
|
include ::RuboCop::Cop::Duplication
|
2634
2746
|
|
2635
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#
|
2747
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#38
|
2636
2748
|
def enum?(param0 = T.unsafe(nil)); end
|
2637
2749
|
|
2638
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#
|
2750
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#46
|
2639
2751
|
def enum_values(param0 = T.unsafe(nil)); end
|
2640
2752
|
|
2641
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#
|
2753
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#42
|
2754
|
+
def enum_with_old_syntax?(param0 = T.unsafe(nil)); end
|
2755
|
+
|
2756
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#50
|
2642
2757
|
def on_send(node); end
|
2643
2758
|
|
2644
2759
|
private
|
2645
2760
|
|
2646
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#
|
2761
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#70
|
2647
2762
|
def enum_name(key); end
|
2763
|
+
|
2764
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#79
|
2765
|
+
def message(key, item); end
|
2648
2766
|
end
|
2649
2767
|
|
2650
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#
|
2768
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#35
|
2651
2769
|
RuboCop::Cop::Rails::EnumUniqueness::MSG = T.let(T.unsafe(nil), String)
|
2652
2770
|
|
2653
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#
|
2771
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/enum_uniqueness.rb#36
|
2654
2772
|
RuboCop::Cop::Rails::EnumUniqueness::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2655
2773
|
|
2656
2774
|
# Checks for usage of `Rails.env.development? || Rails.env.test?` which
|
@@ -3536,6 +3654,8 @@ RuboCop::Cop::Rails::HttpPositionalArguments::ROUTING_METHODS = T.let(T.unsafe(n
|
|
3536
3654
|
# render plain: 'foo/bar', status: 304
|
3537
3655
|
# redirect_to root_url, status: 301
|
3538
3656
|
# head 200
|
3657
|
+
# assert_response 200
|
3658
|
+
# assert_redirected_to '/some/path', status: 301
|
3539
3659
|
#
|
3540
3660
|
# # good
|
3541
3661
|
# render :foo, status: :ok
|
@@ -3543,6 +3663,8 @@ RuboCop::Cop::Rails::HttpPositionalArguments::ROUTING_METHODS = T.let(T.unsafe(n
|
|
3543
3663
|
# render plain: 'foo/bar', status: :not_modified
|
3544
3664
|
# redirect_to root_url, status: :moved_permanently
|
3545
3665
|
# head :ok
|
3666
|
+
# assert_response :ok
|
3667
|
+
# assert_redirected_to '/some/path', status: :moved_permanently
|
3546
3668
|
# @example EnforcedStyle: numeric
|
3547
3669
|
# # bad
|
3548
3670
|
# render :foo, status: :ok
|
@@ -3550,6 +3672,8 @@ RuboCop::Cop::Rails::HttpPositionalArguments::ROUTING_METHODS = T.let(T.unsafe(n
|
|
3550
3672
|
# render plain: 'foo/bar', status: :not_modified
|
3551
3673
|
# redirect_to root_url, status: :moved_permanently
|
3552
3674
|
# head :ok
|
3675
|
+
# assert_response :ok
|
3676
|
+
# assert_redirected_to '/some/path', status: :moved_permanently
|
3553
3677
|
#
|
3554
3678
|
# # good
|
3555
3679
|
# render :foo, status: 200
|
@@ -3557,117 +3681,119 @@ RuboCop::Cop::Rails::HttpPositionalArguments::ROUTING_METHODS = T.let(T.unsafe(n
|
|
3557
3681
|
# render plain: 'foo/bar', status: 304
|
3558
3682
|
# redirect_to root_url, status: 301
|
3559
3683
|
# head 200
|
3684
|
+
# assert_response 200
|
3685
|
+
# assert_redirected_to '/some/path', status: 301
|
3560
3686
|
#
|
3561
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3687
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#47
|
3562
3688
|
class RuboCop::Cop::Rails::HttpStatus < ::RuboCop::Cop::Base
|
3563
3689
|
include ::RuboCop::Cop::ConfigurableEnforcedStyle
|
3564
3690
|
extend ::RuboCop::Cop::AutoCorrector
|
3565
3691
|
|
3566
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3692
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#53
|
3567
3693
|
def http_status(param0 = T.unsafe(nil)); end
|
3568
3694
|
|
3569
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3695
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#67
|
3570
3696
|
def on_send(node); end
|
3571
3697
|
|
3572
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3698
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#63
|
3573
3699
|
def status_code(param0 = T.unsafe(nil)); end
|
3574
3700
|
|
3575
3701
|
private
|
3576
3702
|
|
3577
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3703
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#87
|
3578
3704
|
def checker_class; end
|
3579
3705
|
end
|
3580
3706
|
|
3581
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3707
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#135
|
3582
3708
|
class RuboCop::Cop::Rails::HttpStatus::NumericStyleChecker
|
3583
3709
|
# @return [NumericStyleChecker] a new instance of NumericStyleChecker
|
3584
3710
|
#
|
3585
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3711
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#142
|
3586
3712
|
def initialize(node); end
|
3587
3713
|
|
3588
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3714
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#150
|
3589
3715
|
def message; end
|
3590
3716
|
|
3591
3717
|
# Returns the value of attribute node.
|
3592
3718
|
#
|
3593
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3719
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#140
|
3594
3720
|
def node; end
|
3595
3721
|
|
3596
3722
|
# @return [Boolean]
|
3597
3723
|
#
|
3598
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3724
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#146
|
3599
3725
|
def offensive?; end
|
3600
3726
|
|
3601
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3727
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#154
|
3602
3728
|
def preferred_style; end
|
3603
3729
|
|
3604
3730
|
private
|
3605
3731
|
|
3606
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3732
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#160
|
3607
3733
|
def number; end
|
3608
3734
|
|
3609
3735
|
# @return [Boolean]
|
3610
3736
|
#
|
3611
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3737
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#168
|
3612
3738
|
def permitted_symbol?; end
|
3613
3739
|
|
3614
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3740
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#164
|
3615
3741
|
def symbol; end
|
3616
3742
|
end
|
3617
3743
|
|
3618
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3744
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#137
|
3619
3745
|
RuboCop::Cop::Rails::HttpStatus::NumericStyleChecker::DEFAULT_MSG = T.let(T.unsafe(nil), String)
|
3620
3746
|
|
3621
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3747
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#136
|
3622
3748
|
RuboCop::Cop::Rails::HttpStatus::NumericStyleChecker::MSG = T.let(T.unsafe(nil), String)
|
3623
3749
|
|
3624
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3750
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#138
|
3625
3751
|
RuboCop::Cop::Rails::HttpStatus::NumericStyleChecker::PERMITTED_STATUS = T.let(T.unsafe(nil), Array)
|
3626
3752
|
|
3627
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3753
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#51
|
3628
3754
|
RuboCop::Cop::Rails::HttpStatus::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
3629
3755
|
|
3630
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3756
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#97
|
3631
3757
|
class RuboCop::Cop::Rails::HttpStatus::SymbolicStyleChecker
|
3632
3758
|
# @return [SymbolicStyleChecker] a new instance of SymbolicStyleChecker
|
3633
3759
|
#
|
3634
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3760
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#103
|
3635
3761
|
def initialize(node); end
|
3636
3762
|
|
3637
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3763
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#111
|
3638
3764
|
def message; end
|
3639
3765
|
|
3640
3766
|
# Returns the value of attribute node.
|
3641
3767
|
#
|
3642
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3768
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#101
|
3643
3769
|
def node; end
|
3644
3770
|
|
3645
3771
|
# @return [Boolean]
|
3646
3772
|
#
|
3647
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3773
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#107
|
3648
3774
|
def offensive?; end
|
3649
3775
|
|
3650
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3776
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#115
|
3651
3777
|
def preferred_style; end
|
3652
3778
|
|
3653
3779
|
private
|
3654
3780
|
|
3655
3781
|
# @return [Boolean]
|
3656
3782
|
#
|
3657
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3783
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#129
|
3658
3784
|
def custom_http_status_code?; end
|
3659
3785
|
|
3660
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3786
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#125
|
3661
3787
|
def number; end
|
3662
3788
|
|
3663
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3789
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#121
|
3664
3790
|
def symbol; end
|
3665
3791
|
end
|
3666
3792
|
|
3667
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3793
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#99
|
3668
3794
|
RuboCop::Cop::Rails::HttpStatus::SymbolicStyleChecker::DEFAULT_MSG = T.let(T.unsafe(nil), String)
|
3669
3795
|
|
3670
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#
|
3796
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/http_status.rb#98
|
3671
3797
|
RuboCop::Cop::Rails::HttpStatus::SymbolicStyleChecker::MSG = T.let(T.unsafe(nil), String)
|
3672
3798
|
|
3673
3799
|
# Checks for places where I18n "lazy" lookup can be used.
|
@@ -4421,7 +4547,7 @@ RuboCop::Cop::Rails::LexicallyScopedActionFilter::MSG = T.let(T.unsafe(nil), Str
|
|
4421
4547
|
# source://rubocop-rails//lib/rubocop/cop/rails/lexically_scoped_action_filter.rb#89
|
4422
4548
|
RuboCop::Cop::Rails::LexicallyScopedActionFilter::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
4423
4549
|
|
4424
|
-
# Checks for calls to `link_to` that contain a
|
4550
|
+
# Checks for calls to `link_to`, `link_to_if`, and `link_to_unless` methods that contain a
|
4425
4551
|
# `target: '_blank'` but no `rel: 'noopener'`. This can be a security
|
4426
4552
|
# risk as the loaded page will have control over the previous page
|
4427
4553
|
# and could change its location for phishing purposes.
|
@@ -4667,60 +4793,111 @@ RuboCop::Cop::Rails::NegateInclude::MSG = T.let(T.unsafe(nil), String)
|
|
4667
4793
|
# source://rubocop-rails//lib/rubocop/cop/rails/negate_include.rb#26
|
4668
4794
|
RuboCop::Cop::Rails::NegateInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
4669
4795
|
|
4670
|
-
# Checks for add_column
|
4796
|
+
# Checks for add_column calls with a NOT NULL constraint without a default
|
4797
|
+
# value.
|
4671
4798
|
#
|
4672
|
-
#
|
4673
|
-
#
|
4674
|
-
#
|
4675
|
-
#
|
4676
|
-
#
|
4799
|
+
# This cop only applies when adding a column to an existing table, since
|
4800
|
+
# existing records will not have a value for the new column. New tables
|
4801
|
+
# can freely use NOT NULL columns without defaults, since there are no
|
4802
|
+
# records that could violate the constraint.
|
4803
|
+
#
|
4804
|
+
# If you need to add a NOT NULL column to an existing table, you must add
|
4805
|
+
# it as nullable first, back-fill the data, and then use
|
4806
|
+
# `change_column_null`. Alternatively, you could add the column with a
|
4807
|
+
# default first to have the database automatically backfill existing rows,
|
4808
|
+
# and then use `change_column_default` to remove the default.
|
4809
|
+
#
|
4810
|
+
# `TEXT` cannot have a default value in MySQL.
|
4811
|
+
# The cop will automatically detect an adapter from `development`
|
4812
|
+
# environment in `config/database.yml` or the environment variable
|
4813
|
+
# `DATABASE_URL` when the `Database` option is not set. If the database
|
4814
|
+
# is MySQL, this cop ignores offenses for `TEXT` columns.
|
4677
4815
|
#
|
4678
4816
|
# @example
|
4679
4817
|
# # bad
|
4680
4818
|
# add_column :users, :name, :string, null: false
|
4681
4819
|
# add_reference :products, :category, null: false
|
4820
|
+
# change_table :users do |t|
|
4821
|
+
# t.string :name, null: false
|
4822
|
+
# end
|
4682
4823
|
#
|
4683
4824
|
# # good
|
4684
4825
|
# add_column :users, :name, :string, null: true
|
4685
4826
|
# add_column :users, :name, :string, null: false, default: ''
|
4827
|
+
# change_table :users do |t|
|
4828
|
+
# t.string :name, null: false, default: ''
|
4829
|
+
# end
|
4686
4830
|
# add_reference :products, :category
|
4687
|
-
#
|
4831
|
+
# change_column_null :products, :category_id, false
|
4688
4832
|
#
|
4689
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4833
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#42
|
4690
4834
|
class RuboCop::Cop::Rails::NotNullColumn < ::RuboCop::Cop::Base
|
4691
4835
|
include ::RuboCop::Cop::DatabaseTypeResolvable
|
4692
4836
|
|
4693
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4837
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#48
|
4694
4838
|
def add_not_null_column?(param0 = T.unsafe(nil)); end
|
4695
4839
|
|
4696
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4840
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#60
|
4841
|
+
def add_not_null_column_in_change_table?(param0 = T.unsafe(nil)); end
|
4842
|
+
|
4843
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#64
|
4844
|
+
def add_not_null_column_via_shortcut_in_change_table?(param0 = T.unsafe(nil)); end
|
4845
|
+
|
4846
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#52
|
4697
4847
|
def add_not_null_reference?(param0 = T.unsafe(nil)); end
|
4698
4848
|
|
4699
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4849
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#68
|
4850
|
+
def add_not_null_reference_in_change_table?(param0 = T.unsafe(nil)); end
|
4851
|
+
|
4852
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#56
|
4853
|
+
def change_table?(param0 = T.unsafe(nil)); end
|
4854
|
+
|
4855
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#76
|
4700
4856
|
def default_option?(param0 = T.unsafe(nil)); end
|
4701
4857
|
|
4702
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4858
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#72
|
4703
4859
|
def null_false?(param0 = T.unsafe(nil)); end
|
4704
4860
|
|
4705
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4861
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#85
|
4862
|
+
def on_block(node); end
|
4863
|
+
|
4864
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#85
|
4865
|
+
def on_numblock(node); end
|
4866
|
+
|
4867
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#80
|
4706
4868
|
def on_send(node); end
|
4707
4869
|
|
4708
4870
|
private
|
4709
4871
|
|
4710
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4872
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#101
|
4711
4873
|
def check_add_column(node); end
|
4712
4874
|
|
4713
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4875
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#113
|
4876
|
+
def check_add_column_in_change_table(node, table); end
|
4877
|
+
|
4878
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#121
|
4879
|
+
def check_add_column_via_shortcut_in_change_table(node, table); end
|
4880
|
+
|
4881
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#107
|
4714
4882
|
def check_add_reference(node); end
|
4715
4883
|
|
4716
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4884
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#129
|
4885
|
+
def check_add_reference_in_change_table(node, table); end
|
4886
|
+
|
4887
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#137
|
4888
|
+
def check_change_table(node); end
|
4889
|
+
|
4890
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#92
|
4891
|
+
def check_column(type, pairs); end
|
4892
|
+
|
4893
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#150
|
4717
4894
|
def check_pairs(pairs); end
|
4718
4895
|
end
|
4719
4896
|
|
4720
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4897
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#45
|
4721
4898
|
RuboCop::Cop::Rails::NotNullColumn::MSG = T.let(T.unsafe(nil), String)
|
4722
4899
|
|
4723
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#
|
4900
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/not_null_column.rb#46
|
4724
4901
|
RuboCop::Cop::Rails::NotNullColumn::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
4725
4902
|
|
4726
4903
|
# Checks for places where ordering by `id` column is used.
|
@@ -4913,6 +5090,10 @@ RuboCop::Cop::Rails::OutputSafety::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array
|
|
4913
5090
|
# `pick` avoids. When called on an Active Record relation, `pick` adds a
|
4914
5091
|
# limit to the query so that only one value is fetched from the database.
|
4915
5092
|
#
|
5093
|
+
# Note that when `pick` is added to a relation with an existing limit, it
|
5094
|
+
# causes a subquery to be added. In most cases this is undesirable, and
|
5095
|
+
# care should be taken while resolving this violation.
|
5096
|
+
#
|
4916
5097
|
# @example
|
4917
5098
|
# # bad
|
4918
5099
|
# Model.pluck(:a).first
|
@@ -4922,30 +5103,30 @@ RuboCop::Cop::Rails::OutputSafety::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array
|
|
4922
5103
|
# Model.pick(:a)
|
4923
5104
|
# [{ a: :b, c: :d }].pick(:a, :b)
|
4924
5105
|
#
|
4925
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#
|
5106
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#31
|
4926
5107
|
class RuboCop::Cop::Rails::Pick < ::RuboCop::Cop::Base
|
4927
5108
|
extend ::RuboCop::Cop::AutoCorrector
|
4928
5109
|
extend ::RuboCop::Cop::TargetRailsVersion
|
4929
5110
|
|
4930
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#
|
5111
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#44
|
4931
5112
|
def on_csend(node); end
|
4932
5113
|
|
4933
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#
|
5114
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#44
|
4934
5115
|
def on_send(node); end
|
4935
5116
|
|
4936
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#
|
5117
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#40
|
4937
5118
|
def pick_candidate?(param0 = T.unsafe(nil)); end
|
4938
5119
|
|
4939
5120
|
private
|
4940
5121
|
|
4941
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#
|
5122
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#63
|
4942
5123
|
def message(receiver, current); end
|
4943
5124
|
end
|
4944
5125
|
|
4945
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#
|
5126
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#35
|
4946
5127
|
RuboCop::Cop::Rails::Pick::MSG = T.let(T.unsafe(nil), String)
|
4947
5128
|
|
4948
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#
|
5129
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pick.rb#36
|
4949
5130
|
RuboCop::Cop::Rails::Pick::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
4950
5131
|
|
4951
5132
|
# Enforces the use of `pluck` over `map`.
|
@@ -5052,11 +5233,12 @@ RuboCop::Cop::Rails::PluckId::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
|
5052
5233
|
# and can be replaced with `select`.
|
5053
5234
|
#
|
5054
5235
|
# Since `pluck` is an eager method and hits the database immediately,
|
5055
|
-
# using `select` helps to avoid additional database queries
|
5236
|
+
# using `select` helps to avoid additional database queries by running as
|
5237
|
+
# a subquery.
|
5056
5238
|
#
|
5057
|
-
# This cop has two
|
5058
|
-
#
|
5059
|
-
# (
|
5239
|
+
# This cop has two modes of enforcement. When the `EnforcedStyle` is set
|
5240
|
+
# to `conservative` (the default), only calls to `pluck` on a constant
|
5241
|
+
# (e.g. a model class) within `where` are considered offenses.
|
5060
5242
|
#
|
5061
5243
|
# @example
|
5062
5244
|
# # bad
|
@@ -5075,31 +5257,31 @@ RuboCop::Cop::Rails::PluckId::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
|
5075
5257
|
# # bad
|
5076
5258
|
# Post.where(user_id: active_users.pluck(:id))
|
5077
5259
|
#
|
5078
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#
|
5260
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#50
|
5079
5261
|
class RuboCop::Cop::Rails::PluckInWhere < ::RuboCop::Cop::Base
|
5080
5262
|
include ::RuboCop::Cop::ActiveRecordHelper
|
5081
5263
|
include ::RuboCop::Cop::ConfigurableEnforcedStyle
|
5082
5264
|
extend ::RuboCop::Cop::AutoCorrector
|
5083
5265
|
|
5084
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#
|
5266
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#59
|
5085
5267
|
def on_csend(node); end
|
5086
5268
|
|
5087
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#
|
5269
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#59
|
5088
5270
|
def on_send(node); end
|
5089
5271
|
|
5090
5272
|
private
|
5091
5273
|
|
5092
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#
|
5274
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#81
|
5093
5275
|
def root_receiver(node); end
|
5094
5276
|
end
|
5095
5277
|
|
5096
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#
|
5278
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#56
|
5097
5279
|
RuboCop::Cop::Rails::PluckInWhere::MSG_IDS = T.let(T.unsafe(nil), String)
|
5098
5280
|
|
5099
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#
|
5281
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#55
|
5100
5282
|
RuboCop::Cop::Rails::PluckInWhere::MSG_SELECT = T.let(T.unsafe(nil), String)
|
5101
5283
|
|
5102
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#
|
5284
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluck_in_where.rb#57
|
5103
5285
|
RuboCop::Cop::Rails::PluckInWhere::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
5104
5286
|
|
5105
5287
|
# Checks for correct grammar when using ActiveSupport's
|
@@ -5109,79 +5291,83 @@ RuboCop::Cop::Rails::PluckInWhere::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array
|
|
5109
5291
|
# # bad
|
5110
5292
|
# 3.day.ago
|
5111
5293
|
# 1.months.ago
|
5294
|
+
# 5.megabyte
|
5295
|
+
# 1.gigabyte
|
5112
5296
|
#
|
5113
5297
|
# # good
|
5114
5298
|
# 3.days.ago
|
5115
5299
|
# 1.month.ago
|
5300
|
+
# 5.megabytes
|
5301
|
+
# 1.gigabyte
|
5116
5302
|
#
|
5117
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5303
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#21
|
5118
5304
|
class RuboCop::Cop::Rails::PluralizationGrammar < ::RuboCop::Cop::Base
|
5119
5305
|
extend ::RuboCop::Cop::AutoCorrector
|
5120
5306
|
|
5121
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5307
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#49
|
5122
5308
|
def on_send(node); end
|
5123
5309
|
|
5124
5310
|
private
|
5125
5311
|
|
5126
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5312
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#67
|
5127
5313
|
def correct_method(method_name); end
|
5128
5314
|
|
5129
5315
|
# @return [Boolean]
|
5130
5316
|
#
|
5131
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5317
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#110
|
5132
5318
|
def duration_method?(method_name); end
|
5133
5319
|
|
5134
5320
|
# @return [Boolean]
|
5135
5321
|
#
|
5136
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5322
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#98
|
5137
5323
|
def literal_number?(node); end
|
5138
5324
|
|
5139
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5325
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#63
|
5140
5326
|
def message(number, method_name); end
|
5141
5327
|
|
5142
5328
|
# @return [Boolean]
|
5143
5329
|
#
|
5144
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5330
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#75
|
5145
5331
|
def offense?(node); end
|
5146
5332
|
|
5147
5333
|
# @return [Boolean]
|
5148
5334
|
#
|
5149
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5335
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#82
|
5150
5336
|
def plural_method?(method_name); end
|
5151
5337
|
|
5152
5338
|
# @return [Boolean]
|
5153
5339
|
#
|
5154
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5340
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#94
|
5155
5341
|
def plural_receiver?(number); end
|
5156
5342
|
|
5157
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5343
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#102
|
5158
5344
|
def pluralize(method_name); end
|
5159
5345
|
|
5160
5346
|
# @return [Boolean]
|
5161
5347
|
#
|
5162
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5348
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#86
|
5163
5349
|
def singular_method?(method_name); end
|
5164
5350
|
|
5165
5351
|
# @return [Boolean]
|
5166
5352
|
#
|
5167
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5353
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#90
|
5168
5354
|
def singular_receiver?(number); end
|
5169
5355
|
|
5170
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5356
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#106
|
5171
5357
|
def singularize(method_name); end
|
5172
5358
|
end
|
5173
5359
|
|
5174
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5360
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#47
|
5175
5361
|
RuboCop::Cop::Rails::PluralizationGrammar::MSG = T.let(T.unsafe(nil), String)
|
5176
5362
|
|
5177
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5178
|
-
RuboCop::Cop::Rails::PluralizationGrammar::
|
5363
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#45
|
5364
|
+
RuboCop::Cop::Rails::PluralizationGrammar::PLURAL_METHODS = T.let(T.unsafe(nil), Hash)
|
5179
5365
|
|
5180
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5366
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#43
|
5181
5367
|
RuboCop::Cop::Rails::PluralizationGrammar::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
5182
5368
|
|
5183
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#
|
5184
|
-
RuboCop::Cop::Rails::PluralizationGrammar::
|
5369
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/pluralization_grammar.rb#24
|
5370
|
+
RuboCop::Cop::Rails::PluralizationGrammar::SINGULAR_METHODS = T.let(T.unsafe(nil), Hash)
|
5185
5371
|
|
5186
5372
|
# Checks code that can be written more easily using
|
5187
5373
|
# `Object#presence` defined by Active Support.
|
@@ -5710,7 +5896,7 @@ class RuboCop::Cop::Rails::RedundantPresenceValidationOnBelongsTo < ::RuboCop::C
|
|
5710
5896
|
# @param association [Symbol]
|
5711
5897
|
# @return [Array<RuboCop::AST::Node>, nil] matching node
|
5712
5898
|
#
|
5713
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5899
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#109
|
5714
5900
|
def any_belongs_to?(param0 = T.unsafe(nil), association:); end
|
5715
5901
|
|
5716
5902
|
# Match a class with a matching association, either by name or an explicit
|
@@ -5727,7 +5913,7 @@ class RuboCop::Cop::Rails::RedundantPresenceValidationOnBelongsTo < ::RuboCop::C
|
|
5727
5913
|
# @param fk [Symbol] e.g. `:user_id`
|
5728
5914
|
# @return [Array<RuboCop::AST::Node>] matching nodes
|
5729
5915
|
#
|
5730
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5916
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#135
|
5731
5917
|
def belongs_to?(param0 = T.unsafe(nil), key:, fk:); end
|
5732
5918
|
|
5733
5919
|
# Match a matching `belongs_to` association with a matching explicit `foreign_key` option
|
@@ -5738,7 +5924,7 @@ class RuboCop::Cop::Rails::RedundantPresenceValidationOnBelongsTo < ::RuboCop::C
|
|
5738
5924
|
# @param fk [Symbol] e.g. `:user_id`
|
5739
5925
|
# @return [Array<RuboCop::AST::Node>] matching nodes
|
5740
5926
|
#
|
5741
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5927
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#170
|
5742
5928
|
def belongs_to_with_a_matching_fk?(param0 = T.unsafe(nil), param1); end
|
5743
5929
|
|
5744
5930
|
# Match a matching `belongs_to` association, without an explicit `foreign_key` option
|
@@ -5747,20 +5933,20 @@ class RuboCop::Cop::Rails::RedundantPresenceValidationOnBelongsTo < ::RuboCop::C
|
|
5747
5933
|
# @param key [Symbol] e.g. `:user`
|
5748
5934
|
# @return [Array<RuboCop::AST::Node>] matching nodes
|
5749
5935
|
#
|
5750
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5936
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#153
|
5751
5937
|
def belongs_to_without_fk?(param0 = T.unsafe(nil), param1); end
|
5752
5938
|
|
5753
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5939
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#174
|
5754
5940
|
def on_send(node); end
|
5755
5941
|
|
5756
5942
|
# Match a `belongs_to` association with an optional option in a hash
|
5757
5943
|
#
|
5758
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5944
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#84
|
5759
5945
|
def optional?(param0 = T.unsafe(nil)); end
|
5760
5946
|
|
5761
5947
|
# Match an optional option in a hash
|
5762
5948
|
#
|
5763
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5949
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#90
|
5764
5950
|
def optional_option?(param0 = T.unsafe(nil)); end
|
5765
5951
|
|
5766
5952
|
# Match a `validates` statement with a presence check
|
@@ -5780,42 +5966,47 @@ class RuboCop::Cop::Rails::RedundantPresenceValidationOnBelongsTo < ::RuboCop::C
|
|
5780
5966
|
# @example source that DOES NOT match - custom strict validation
|
5781
5967
|
# validates :user_id, presence: true, strict: MissingUserError
|
5782
5968
|
#
|
5783
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5969
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#70
|
5784
5970
|
def presence_validation?(param0 = T.unsafe(nil)); end
|
5785
5971
|
|
5786
5972
|
private
|
5787
5973
|
|
5788
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5974
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#191
|
5789
5975
|
def add_offense_and_correct(node, all_keys, keys, options, presence); end
|
5790
5976
|
|
5791
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5977
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#219
|
5792
5978
|
def belongs_to_for(model_class_node, key); end
|
5793
5979
|
|
5794
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5980
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#251
|
5795
5981
|
def extract_validation_for_keys(corrector, node, keys, options); end
|
5796
5982
|
|
5797
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5983
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#207
|
5798
5984
|
def message_for(keys); end
|
5799
5985
|
|
5800
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5986
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#212
|
5801
5987
|
def non_optional_belongs_to(node, keys); end
|
5802
5988
|
|
5803
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5989
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#232
|
5804
5990
|
def remove_keys_from_validation(corrector, node, keys); end
|
5805
5991
|
|
5806
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5992
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#243
|
5807
5993
|
def remove_presence_option(corrector, presence); end
|
5808
5994
|
|
5809
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5995
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#228
|
5810
5996
|
def remove_validation(corrector, node); end
|
5811
5997
|
|
5812
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#
|
5998
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#267
|
5813
5999
|
def validation_range(node); end
|
5814
6000
|
end
|
5815
6001
|
|
5816
6002
|
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#39
|
5817
6003
|
RuboCop::Cop::Rails::RedundantPresenceValidationOnBelongsTo::MSG = T.let(T.unsafe(nil), String)
|
5818
6004
|
|
6005
|
+
# From https://github.com/rails/rails/blob/7a0bf93b9dd291c7f61121a41b3a813ac8857e6a/activemodel/lib/active_model/validations/validates.rb#L157-L159
|
6006
|
+
#
|
6007
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#43
|
6008
|
+
RuboCop::Cop::Rails::RedundantPresenceValidationOnBelongsTo::NON_VALIDATION_OPTIONS = T.let(T.unsafe(nil), Array)
|
6009
|
+
|
5819
6010
|
# source://rubocop-rails//lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb#40
|
5820
6011
|
RuboCop::Cop::Rails::RedundantPresenceValidationOnBelongsTo::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
5821
6012
|
|
@@ -6206,12 +6397,12 @@ class RuboCop::Cop::Rails::RenderPlainText < ::RuboCop::Cop::Base
|
|
6206
6397
|
# @return [Boolean]
|
6207
6398
|
#
|
6208
6399
|
# source://rubocop-rails//lib/rubocop/cop/rails/render_plain_text.rb#56
|
6209
|
-
def compatible_content_type?(
|
6400
|
+
def compatible_content_type?(pair_node); end
|
6210
6401
|
|
6211
6402
|
# source://rubocop-rails//lib/rubocop/cop/rails/render_plain_text.rb#52
|
6212
6403
|
def find_content_type(node); end
|
6213
6404
|
|
6214
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/render_plain_text.rb#
|
6405
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/render_plain_text.rb#64
|
6215
6406
|
def replacement(rest_options, option_value); end
|
6216
6407
|
end
|
6217
6408
|
|
@@ -6343,25 +6534,21 @@ RuboCop::Cop::Rails::ResponseParsedBody::RESTRICT_ON_SEND = T.let(T.unsafe(nil),
|
|
6343
6534
|
# reversible.
|
6344
6535
|
#
|
6345
6536
|
# @example
|
6537
|
+
# # remove_index
|
6538
|
+
#
|
6346
6539
|
# # bad
|
6347
6540
|
# def change
|
6348
|
-
#
|
6349
|
-
# t.remove :name
|
6350
|
-
# end
|
6541
|
+
# remove_index :users, name: :index_users_on_email
|
6351
6542
|
# end
|
6352
6543
|
#
|
6353
6544
|
# # good
|
6354
6545
|
# def change
|
6355
|
-
#
|
6356
|
-
# t.remove :name, type: :string
|
6357
|
-
# end
|
6546
|
+
# remove_index :users, :email
|
6358
6547
|
# end
|
6359
6548
|
#
|
6360
6549
|
# # good
|
6361
6550
|
# def change
|
6362
|
-
#
|
6363
|
-
# t.string :name
|
6364
|
-
# end
|
6551
|
+
# remove_index :users, column: :email
|
6365
6552
|
# end
|
6366
6553
|
# @example
|
6367
6554
|
# # drop_table
|
@@ -6463,21 +6650,25 @@ RuboCop::Cop::Rails::ResponseParsedBody::RESTRICT_ON_SEND = T.let(T.unsafe(nil),
|
|
6463
6650
|
# remove_columns :users, :name, :email, type: :string
|
6464
6651
|
# end
|
6465
6652
|
# @example
|
6466
|
-
# # remove_index
|
6467
|
-
#
|
6468
6653
|
# # bad
|
6469
6654
|
# def change
|
6470
|
-
#
|
6655
|
+
# change_table :users do |t|
|
6656
|
+
# t.remove :name
|
6657
|
+
# end
|
6471
6658
|
# end
|
6472
6659
|
#
|
6473
6660
|
# # good
|
6474
6661
|
# def change
|
6475
|
-
#
|
6662
|
+
# change_table :users do |t|
|
6663
|
+
# t.remove :name, type: :string
|
6664
|
+
# end
|
6476
6665
|
# end
|
6477
6666
|
#
|
6478
6667
|
# # good
|
6479
6668
|
# def change
|
6480
|
-
#
|
6669
|
+
# create_table :users do |t|
|
6670
|
+
# t.string :name
|
6671
|
+
# end
|
6481
6672
|
# end
|
6482
6673
|
#
|
6483
6674
|
# source://rubocop-rails//lib/rubocop/cop/rails/reversible_migration.rb#153
|
@@ -6716,7 +6907,7 @@ class RuboCop::Cop::Rails::RootPathnameMethods < ::RuboCop::Cop::Base
|
|
6716
6907
|
private
|
6717
6908
|
|
6718
6909
|
# source://rubocop-rails//lib/rubocop/cop/rails/root_pathname_methods.rb#220
|
6719
|
-
def build_path_glob_replacement(path
|
6910
|
+
def build_path_glob_replacement(path); end
|
6720
6911
|
|
6721
6912
|
# source://rubocop-rails//lib/rubocop/cop/rails/root_pathname_methods.rb#228
|
6722
6913
|
def build_path_replacement(path, method, args); end
|
@@ -7378,46 +7569,46 @@ RuboCop::Cop::Rails::ShortI18n::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
|
7378
7569
|
# # good
|
7379
7570
|
# user.touch
|
7380
7571
|
#
|
7381
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7572
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#41
|
7382
7573
|
class RuboCop::Cop::Rails::SkipsModelValidations < ::RuboCop::Cop::Base
|
7383
7574
|
# @return [SkipsModelValidations] a new instance of SkipsModelValidations
|
7384
7575
|
#
|
7385
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7576
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#86
|
7386
7577
|
def initialize(*_arg0); end
|
7387
7578
|
|
7388
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7579
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#68
|
7389
7580
|
def good_insert?(param0 = T.unsafe(nil)); end
|
7390
7581
|
|
7391
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7582
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#61
|
7392
7583
|
def good_touch?(param0 = T.unsafe(nil)); end
|
7393
7584
|
|
7394
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7585
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#75
|
7395
7586
|
def on_csend(node); end
|
7396
7587
|
|
7397
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7588
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#75
|
7398
7589
|
def on_send(node); end
|
7399
7590
|
|
7400
7591
|
private
|
7401
7592
|
|
7402
7593
|
# @return [Boolean]
|
7403
7594
|
#
|
7404
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7595
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#98
|
7405
7596
|
def allowed_method?(node); end
|
7406
7597
|
|
7407
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7598
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#113
|
7408
7599
|
def allowed_methods; end
|
7409
7600
|
|
7410
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7601
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#102
|
7411
7602
|
def forbidden_methods; end
|
7412
7603
|
|
7413
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7604
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#94
|
7414
7605
|
def message(node); end
|
7415
7606
|
end
|
7416
7607
|
|
7417
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7608
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#44
|
7418
7609
|
RuboCop::Cop::Rails::SkipsModelValidations::METHODS_WITH_ARGUMENTS = T.let(T.unsafe(nil), Array)
|
7419
7610
|
|
7420
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#
|
7611
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/skips_model_validations.rb#42
|
7421
7612
|
RuboCop::Cop::Rails::SkipsModelValidations::MSG = T.let(T.unsafe(nil), String)
|
7422
7613
|
|
7423
7614
|
# Checks SQL heredocs to use `.squish`.
|
@@ -8243,6 +8434,12 @@ RuboCop::Cop::Rails::UnknownEnv::MSG_SIMILAR = T.let(T.unsafe(nil), String)
|
|
8243
8434
|
# `ignored_columns` is necessary to drop a column from RDBMS, but you don't need it after the migration
|
8244
8435
|
# to drop the column. You avoid forgetting to remove `ignored_columns` by this cop.
|
8245
8436
|
#
|
8437
|
+
# IMPORTANT: This cop can't be used to effectively check for unused columns because the development
|
8438
|
+
# and production schema can be out of sync until the migration has been run on production. As such,
|
8439
|
+
# this cop can cause `ignored_columns` to be removed even though the production schema still contains
|
8440
|
+
# the column, which can lead to downtime when the migration is actually executed. Only enable this cop
|
8441
|
+
# if you know your migrations will be run before any of your Rails applications boot with the modified code.
|
8442
|
+
#
|
8246
8443
|
# @example
|
8247
8444
|
# # bad
|
8248
8445
|
# class User < ApplicationRecord
|
@@ -8254,41 +8451,41 @@ RuboCop::Cop::Rails::UnknownEnv::MSG_SIMILAR = T.let(T.unsafe(nil), String)
|
|
8254
8451
|
# self.ignored_columns = [:still_existing_column]
|
8255
8452
|
# end
|
8256
8453
|
#
|
8257
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8454
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#27
|
8258
8455
|
class RuboCop::Cop::Rails::UnusedIgnoredColumns < ::RuboCop::Cop::Base
|
8259
8456
|
include ::RuboCop::Cop::ActiveRecordHelper
|
8260
8457
|
|
8261
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8458
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#37
|
8262
8459
|
def appended_ignored_columns(param0 = T.unsafe(nil)); end
|
8263
8460
|
|
8264
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8461
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#41
|
8265
8462
|
def column_name(param0 = T.unsafe(nil)); end
|
8266
8463
|
|
8267
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8464
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#33
|
8268
8465
|
def ignored_columns(param0 = T.unsafe(nil)); end
|
8269
8466
|
|
8270
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8467
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#45
|
8271
8468
|
def on_op_asgn(node); end
|
8272
8469
|
|
8273
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8470
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#45
|
8274
8471
|
def on_send(node); end
|
8275
8472
|
|
8276
8473
|
private
|
8277
8474
|
|
8278
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8475
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#60
|
8279
8476
|
def check_column_existence(column_node, table); end
|
8280
8477
|
|
8281
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8478
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#69
|
8282
8479
|
def class_node(node); end
|
8283
8480
|
|
8284
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8481
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#73
|
8285
8482
|
def table(node); end
|
8286
8483
|
end
|
8287
8484
|
|
8288
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8485
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#30
|
8289
8486
|
RuboCop::Cop::Rails::UnusedIgnoredColumns::MSG = T.let(T.unsafe(nil), String)
|
8290
8487
|
|
8291
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#
|
8488
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/unused_ignored_columns.rb#31
|
8292
8489
|
RuboCop::Cop::Rails::UnusedIgnoredColumns::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
8293
8490
|
|
8294
8491
|
# If you try to render content along with a non-content status code (100-199, 204, 205, or 304),
|
@@ -8339,6 +8536,7 @@ RuboCop::Cop::Rails::UnusedRenderContent::RESTRICT_ON_SEND = T.let(T.unsafe(nil)
|
|
8339
8536
|
# @example
|
8340
8537
|
# # bad
|
8341
8538
|
# validates_acceptance_of :foo
|
8539
|
+
# validates_comparison_of :foo
|
8342
8540
|
# validates_confirmation_of :foo
|
8343
8541
|
# validates_exclusion_of :foo
|
8344
8542
|
# validates_format_of :foo
|
@@ -8353,6 +8551,7 @@ RuboCop::Cop::Rails::UnusedRenderContent::RESTRICT_ON_SEND = T.let(T.unsafe(nil)
|
|
8353
8551
|
# # good
|
8354
8552
|
# validates :foo, acceptance: true
|
8355
8553
|
# validates :foo, confirmation: true
|
8554
|
+
# validates :foo, comparison: true
|
8356
8555
|
# validates :foo, exclusion: true
|
8357
8556
|
# validates :foo, format: true
|
8358
8557
|
# validates :foo, inclusion: true
|
@@ -8360,63 +8559,65 @@ RuboCop::Cop::Rails::UnusedRenderContent::RESTRICT_ON_SEND = T.let(T.unsafe(nil)
|
|
8360
8559
|
# validates :foo, numericality: true
|
8361
8560
|
# validates :foo, presence: true
|
8362
8561
|
# validates :foo, absence: true
|
8363
|
-
# validates :foo,
|
8562
|
+
# validates :foo, length: true
|
8364
8563
|
# validates :foo, uniqueness: true
|
8365
8564
|
#
|
8366
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8565
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#37
|
8367
8566
|
class RuboCop::Cop::Rails::Validation < ::RuboCop::Cop::Base
|
8368
8567
|
extend ::RuboCop::Cop::AutoCorrector
|
8369
8568
|
|
8370
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8569
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#60
|
8371
8570
|
def on_send(node); end
|
8372
8571
|
|
8373
8572
|
private
|
8374
8573
|
|
8375
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8574
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#135
|
8376
8575
|
def braced_options(options); end
|
8377
8576
|
|
8378
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8577
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#86
|
8379
8578
|
def correct_validate_type(corrector, node); end
|
8380
8579
|
|
8381
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8580
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#111
|
8382
8581
|
def correct_validate_type_for_array(corrector, node, arguments, loc); end
|
8383
8582
|
|
8384
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8583
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#107
|
8385
8584
|
def correct_validate_type_for_hash(corrector, node, arguments); end
|
8386
8585
|
|
8387
8586
|
# @return [Boolean]
|
8388
8587
|
#
|
8389
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8588
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#131
|
8390
8589
|
def frozen_array_argument?(argument); end
|
8391
8590
|
|
8392
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8591
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#76
|
8393
8592
|
def message(node); end
|
8394
8593
|
|
8395
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8594
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#82
|
8396
8595
|
def preferred_method(method); end
|
8397
8596
|
|
8398
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8597
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#125
|
8399
8598
|
def validate_type(node); end
|
8400
8599
|
end
|
8401
8600
|
|
8402
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8601
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#58
|
8403
8602
|
RuboCop::Cop::Rails::Validation::ALLOWLIST = T.let(T.unsafe(nil), Array)
|
8404
8603
|
|
8405
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8604
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#40
|
8406
8605
|
RuboCop::Cop::Rails::Validation::MSG = T.let(T.unsafe(nil), String)
|
8407
8606
|
|
8408
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8607
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#57
|
8409
8608
|
RuboCop::Cop::Rails::Validation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
8410
8609
|
|
8411
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#
|
8610
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/validation.rb#42
|
8412
8611
|
RuboCop::Cop::Rails::Validation::TYPES = T.let(T.unsafe(nil), Array)
|
8413
8612
|
|
8414
8613
|
# Identifies places where manually constructed SQL
|
8415
|
-
# in `where` can be replaced with
|
8614
|
+
# in `where` and `where.not` can be replaced with
|
8615
|
+
# `where(attribute: value)` and `where.not(attribute: value)`.
|
8416
8616
|
#
|
8417
8617
|
# @example
|
8418
8618
|
# # bad
|
8419
8619
|
# User.where('name = ?', 'Gabe')
|
8620
|
+
# User.where.not('name = ?', 'Gabe')
|
8420
8621
|
# User.where('name = :name', name: 'Gabe')
|
8421
8622
|
# User.where('name IS NULL')
|
8422
8623
|
# User.where('name IN (?)', ['john', 'jane'])
|
@@ -8425,65 +8626,71 @@ RuboCop::Cop::Rails::Validation::TYPES = T.let(T.unsafe(nil), Array)
|
|
8425
8626
|
#
|
8426
8627
|
# # good
|
8427
8628
|
# User.where(name: 'Gabe')
|
8629
|
+
# User.where.not(name: 'Gabe')
|
8428
8630
|
# User.where(name: nil)
|
8429
8631
|
# User.where(name: ['john', 'jane'])
|
8430
8632
|
# User.where(users: { name: 'Gabe' })
|
8431
8633
|
#
|
8432
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8634
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#30
|
8433
8635
|
class RuboCop::Cop::Rails::WhereEquals < ::RuboCop::Cop::Base
|
8434
8636
|
include ::RuboCop::Cop::RangeHelp
|
8435
8637
|
extend ::RuboCop::Cop::AutoCorrector
|
8436
8638
|
|
8437
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8639
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#44
|
8438
8640
|
def on_csend(node); end
|
8439
8641
|
|
8440
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8642
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#44
|
8441
8643
|
def on_send(node); end
|
8442
8644
|
|
8443
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8645
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#37
|
8444
8646
|
def where_method_call?(param0 = T.unsafe(nil)); end
|
8445
8647
|
|
8446
8648
|
private
|
8447
8649
|
|
8448
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8449
|
-
def build_good_method(column, value); end
|
8650
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#96
|
8651
|
+
def build_good_method(method_name, column, value); end
|
8450
8652
|
|
8451
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8653
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#77
|
8452
8654
|
def extract_column_and_value(template_node, value_node); end
|
8453
8655
|
|
8454
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8656
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#73
|
8455
8657
|
def offense_range(node); end
|
8658
|
+
|
8659
|
+
# @return [Boolean]
|
8660
|
+
#
|
8661
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#106
|
8662
|
+
def where_not?(node); end
|
8456
8663
|
end
|
8457
8664
|
|
8458
8665
|
# column = ?
|
8459
8666
|
#
|
8460
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8667
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#65
|
8461
8668
|
RuboCop::Cop::Rails::WhereEquals::EQ_ANONYMOUS_RE = T.let(T.unsafe(nil), Regexp)
|
8462
8669
|
|
8463
8670
|
# column = :column
|
8464
8671
|
#
|
8465
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8672
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#67
|
8466
8673
|
RuboCop::Cop::Rails::WhereEquals::EQ_NAMED_RE = T.let(T.unsafe(nil), Regexp)
|
8467
8674
|
|
8468
8675
|
# column IN (?)
|
8469
8676
|
#
|
8470
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8677
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#66
|
8471
8678
|
RuboCop::Cop::Rails::WhereEquals::IN_ANONYMOUS_RE = T.let(T.unsafe(nil), Regexp)
|
8472
8679
|
|
8473
8680
|
# column IN (:column)
|
8474
8681
|
#
|
8475
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8682
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#68
|
8476
8683
|
RuboCop::Cop::Rails::WhereEquals::IN_NAMED_RE = T.let(T.unsafe(nil), Regexp)
|
8477
8684
|
|
8478
8685
|
# column IS NULL
|
8479
8686
|
#
|
8480
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8687
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#69
|
8481
8688
|
RuboCop::Cop::Rails::WhereEquals::IS_NULL_RE = T.let(T.unsafe(nil), Regexp)
|
8482
8689
|
|
8483
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8690
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#34
|
8484
8691
|
RuboCop::Cop::Rails::WhereEquals::MSG = T.let(T.unsafe(nil), String)
|
8485
8692
|
|
8486
|
-
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#
|
8693
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_equals.rb#35
|
8487
8694
|
RuboCop::Cop::Rails::WhereEquals::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
8488
8695
|
|
8489
8696
|
# Enforces consistent style when using `exists?`.
|
@@ -8761,69 +8968,179 @@ RuboCop::Cop::Rails::WhereNotWithMultipleConditions::MSG = T.let(T.unsafe(nil),
|
|
8761
8968
|
# source://rubocop-rails//lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb#27
|
8762
8969
|
RuboCop::Cop::Rails::WhereNotWithMultipleConditions::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
8763
8970
|
|
8971
|
+
# Identifies places where manually constructed SQL
|
8972
|
+
# in `where` can be replaced with ranges.
|
8973
|
+
#
|
8974
|
+
# @example
|
8975
|
+
# # bad
|
8976
|
+
# User.where('age >= ?', 18)
|
8977
|
+
# User.where.not('age >= ?', 18)
|
8978
|
+
# User.where('age < ?', 18)
|
8979
|
+
# User.where('age >= ? AND age < ?', 18, 21)
|
8980
|
+
# User.where('age >= :start', start: 18)
|
8981
|
+
# User.where('users.age >= ?', 18)
|
8982
|
+
#
|
8983
|
+
# # good
|
8984
|
+
# User.where(age: 18..)
|
8985
|
+
# User.where.not(age: 18..)
|
8986
|
+
# User.where(age: ...18)
|
8987
|
+
# User.where(age: 18...21)
|
8988
|
+
# User.where(users: { age: 18.. })
|
8989
|
+
#
|
8990
|
+
# # good
|
8991
|
+
# # There are no beginless ranges in ruby.
|
8992
|
+
# User.where('age > ?', 18)
|
8993
|
+
#
|
8994
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#37
|
8995
|
+
class RuboCop::Cop::Rails::WhereRange < ::RuboCop::Cop::Base
|
8996
|
+
include ::RuboCop::Cop::RangeHelp
|
8997
|
+
extend ::RuboCop::Cop::AutoCorrector
|
8998
|
+
extend ::RuboCop::Cop::TargetRubyVersion
|
8999
|
+
extend ::RuboCop::Cop::TargetRailsVersion
|
9000
|
+
|
9001
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#70
|
9002
|
+
def on_send(node); end
|
9003
|
+
|
9004
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#63
|
9005
|
+
def where_range_call?(param0 = T.unsafe(nil)); end
|
9006
|
+
|
9007
|
+
private
|
9008
|
+
|
9009
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#169
|
9010
|
+
def build_good_method(method_name, column, value); end
|
9011
|
+
|
9012
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#96
|
9013
|
+
def extract_column_and_value(template_node, values_node); end
|
9014
|
+
|
9015
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#161
|
9016
|
+
def find_pair(hash_node, value); end
|
9017
|
+
|
9018
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#165
|
9019
|
+
def offense_range(node); end
|
9020
|
+
|
9021
|
+
# @return [Boolean]
|
9022
|
+
#
|
9023
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#179
|
9024
|
+
def parentheses_needed?(node); end
|
9025
|
+
|
9026
|
+
# @return [Boolean]
|
9027
|
+
#
|
9028
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#183
|
9029
|
+
def parentheses_not_needed?(node); end
|
9030
|
+
|
9031
|
+
# @return [Boolean]
|
9032
|
+
#
|
9033
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#192
|
9034
|
+
def parenthesized_call_node?(node); end
|
9035
|
+
|
9036
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#157
|
9037
|
+
def range_operator(comparison_operator); end
|
9038
|
+
|
9039
|
+
# @return [Boolean]
|
9040
|
+
#
|
9041
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#90
|
9042
|
+
def where_not?(node); end
|
9043
|
+
end
|
9044
|
+
|
9045
|
+
# column >= ?
|
9046
|
+
#
|
9047
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#48
|
9048
|
+
RuboCop::Cop::Rails::WhereRange::GTEQ_ANONYMOUS_RE = T.let(T.unsafe(nil), Regexp)
|
9049
|
+
|
9050
|
+
# column >= :value
|
9051
|
+
#
|
9052
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#54
|
9053
|
+
RuboCop::Cop::Rails::WhereRange::GTEQ_NAMED_RE = T.let(T.unsafe(nil), Regexp)
|
9054
|
+
|
9055
|
+
# column <[=] ?
|
9056
|
+
#
|
9057
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#50
|
9058
|
+
RuboCop::Cop::Rails::WhereRange::LTEQ_ANONYMOUS_RE = T.let(T.unsafe(nil), Regexp)
|
9059
|
+
|
9060
|
+
# column <[=] :value
|
9061
|
+
#
|
9062
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#56
|
9063
|
+
RuboCop::Cop::Rails::WhereRange::LTEQ_NAMED_RE = T.let(T.unsafe(nil), Regexp)
|
9064
|
+
|
9065
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#43
|
9066
|
+
RuboCop::Cop::Rails::WhereRange::MSG = T.let(T.unsafe(nil), String)
|
9067
|
+
|
9068
|
+
# column >= ? AND column <[=] ?
|
9069
|
+
#
|
9070
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#52
|
9071
|
+
RuboCop::Cop::Rails::WhereRange::RANGE_ANONYMOUS_RE = T.let(T.unsafe(nil), Regexp)
|
9072
|
+
|
9073
|
+
# column >= :value1 AND column <[=] :value2
|
9074
|
+
#
|
9075
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#58
|
9076
|
+
RuboCop::Cop::Rails::WhereRange::RANGE_NAMED_RE = T.let(T.unsafe(nil), Regexp)
|
9077
|
+
|
9078
|
+
# source://rubocop-rails//lib/rubocop/cop/rails/where_range.rb#45
|
9079
|
+
RuboCop::Cop::Rails::WhereRange::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
9080
|
+
|
8764
9081
|
module RuboCop::Cop::Style; end
|
8765
9082
|
|
8766
9083
|
class RuboCop::Cop::Style::InverseMethods < ::RuboCop::Cop::Base
|
8767
|
-
# source://rubocop/1.
|
9084
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#70
|
8768
9085
|
def inverse_block?(param0 = T.unsafe(nil)); end
|
8769
9086
|
|
8770
|
-
# source://rubocop/1.
|
9087
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#61
|
8771
9088
|
def inverse_candidate?(param0 = T.unsafe(nil)); end
|
8772
9089
|
|
8773
|
-
# source://rubocop/1.
|
9090
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#92
|
8774
9091
|
def on_block(node); end
|
8775
9092
|
|
8776
|
-
# source://rubocop/1.
|
9093
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#78
|
8777
9094
|
def on_csend(node); end
|
8778
9095
|
|
8779
|
-
# source://rubocop/1.
|
9096
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#92
|
8780
9097
|
def on_numblock(node); end
|
8781
9098
|
|
8782
|
-
# source://rubocop/1.
|
9099
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#78
|
8783
9100
|
def on_send(node); end
|
8784
9101
|
|
8785
9102
|
private
|
8786
9103
|
|
8787
|
-
# source://rubocop/1.
|
9104
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#177
|
8788
9105
|
def camel_case_constant?(node); end
|
8789
9106
|
|
8790
|
-
# source://rubocop/1.
|
9107
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#121
|
8791
9108
|
def correct_inverse_block(corrector, node); end
|
8792
9109
|
|
8793
|
-
# source://rubocop/1.
|
9110
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#112
|
8794
9111
|
def correct_inverse_method(corrector, node); end
|
8795
9112
|
|
8796
|
-
# source://rubocop/1.
|
9113
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#128
|
8797
9114
|
def correct_inverse_selector(block, corrector); end
|
8798
9115
|
|
8799
|
-
# source://rubocop/1.
|
9116
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#181
|
8800
9117
|
def dot_range(loc); end
|
8801
9118
|
|
8802
|
-
# source://rubocop/1.
|
9119
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#166
|
8803
9120
|
def end_parentheses(node, method_call); end
|
8804
9121
|
|
8805
|
-
# source://rubocop/1.
|
9122
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#150
|
8806
9123
|
def inverse_blocks; end
|
8807
9124
|
|
8808
|
-
# source://rubocop/1.
|
9125
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#145
|
8809
9126
|
def inverse_methods; end
|
8810
9127
|
|
8811
|
-
# source://rubocop/1.
|
9128
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#191
|
8812
9129
|
def message(method, inverse); end
|
8813
9130
|
|
8814
|
-
# source://rubocop/1.
|
9131
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#154
|
8815
9132
|
def negated?(node); end
|
8816
9133
|
|
8817
|
-
# source://rubocop/1.
|
9134
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#162
|
8818
9135
|
def not_to_receiver(node, method_call); end
|
8819
9136
|
|
8820
|
-
# source://rubocop/1.
|
9137
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#172
|
8821
9138
|
def possible_class_hierarchy_check?(lhs, rhs, method); end
|
8822
9139
|
|
8823
|
-
# source://rubocop/1.
|
9140
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#158
|
8824
9141
|
def relational_comparison_with_safe_navigation?(node); end
|
8825
9142
|
|
8826
|
-
# source://rubocop/1.
|
9143
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/inverse_methods.rb#185
|
8827
9144
|
def remove_end_parenthesis(corrector, node, method, method_call); end
|
8828
9145
|
|
8829
9146
|
class << self
|
@@ -8833,24 +9150,24 @@ class RuboCop::Cop::Style::InverseMethods < ::RuboCop::Cop::Base
|
|
8833
9150
|
end
|
8834
9151
|
|
8835
9152
|
class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base
|
8836
|
-
# source://rubocop/1.
|
9153
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/method_call_with_args_parentheses.rb#217
|
8837
9154
|
def on_csend(node); end
|
8838
9155
|
|
8839
|
-
# source://rubocop/1.
|
9156
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/method_call_with_args_parentheses.rb#217
|
8840
9157
|
def on_send(node); end
|
8841
9158
|
|
8842
|
-
# source://rubocop/1.
|
9159
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/method_call_with_args_parentheses.rb#217
|
8843
9160
|
def on_yield(node); end
|
8844
9161
|
|
8845
9162
|
private
|
8846
9163
|
|
8847
|
-
# source://rubocop/1.
|
9164
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/method_call_with_args_parentheses.rb#225
|
8848
9165
|
def args_begin(node); end
|
8849
9166
|
|
8850
|
-
# source://rubocop/1.
|
9167
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/method_call_with_args_parentheses.rb#233
|
8851
9168
|
def args_end(node); end
|
8852
9169
|
|
8853
|
-
# source://rubocop/1.
|
9170
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/method_call_with_args_parentheses.rb#237
|
8854
9171
|
def args_parenthesized?(node); end
|
8855
9172
|
|
8856
9173
|
class << self
|
@@ -8860,84 +9177,84 @@ class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base
|
|
8860
9177
|
end
|
8861
9178
|
|
8862
9179
|
class RuboCop::Cop::Style::RedundantSelf < ::RuboCop::Cop::Base
|
8863
|
-
# source://rubocop/1.
|
9180
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#60
|
8864
9181
|
def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end
|
8865
9182
|
|
8866
|
-
# source://rubocop/1.
|
9183
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#68
|
8867
9184
|
def on_and_asgn(node); end
|
8868
9185
|
|
8869
|
-
# source://rubocop/1.
|
9186
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#86
|
8870
9187
|
def on_args(node); end
|
8871
9188
|
|
8872
|
-
# source://rubocop/1.
|
9189
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#120
|
8873
9190
|
def on_block(node); end
|
8874
9191
|
|
8875
|
-
# source://rubocop/1.
|
9192
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#90
|
8876
9193
|
def on_blockarg(node); end
|
8877
9194
|
|
8878
|
-
# source://rubocop/1.
|
9195
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#81
|
8879
9196
|
def on_def(node); end
|
8880
9197
|
|
8881
|
-
# source://rubocop/1.
|
9198
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#81
|
8882
9199
|
def on_defs(node); end
|
8883
9200
|
|
8884
|
-
# source://rubocop/1.
|
9201
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#126
|
8885
9202
|
def on_if(node); end
|
8886
9203
|
|
8887
|
-
# source://rubocop/1.
|
9204
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#104
|
8888
9205
|
def on_in_pattern(node); end
|
8889
9206
|
|
8890
|
-
# source://rubocop/1.
|
9207
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#99
|
8891
9208
|
def on_lvasgn(node); end
|
8892
9209
|
|
8893
|
-
# source://rubocop/1.
|
9210
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#94
|
8894
9211
|
def on_masgn(node); end
|
8895
9212
|
|
8896
|
-
# source://rubocop/1.
|
9213
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#120
|
8897
9214
|
def on_numblock(node); end
|
8898
9215
|
|
8899
|
-
# source://rubocop/1.
|
9216
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#74
|
8900
9217
|
def on_op_asgn(node); end
|
8901
9218
|
|
8902
|
-
# source://rubocop/1.
|
9219
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#68
|
8903
9220
|
def on_or_asgn(node); end
|
8904
9221
|
|
8905
|
-
# source://rubocop/1.
|
9222
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#108
|
8906
9223
|
def on_send(node); end
|
8907
9224
|
|
8908
|
-
# source://rubocop/1.
|
9225
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#126
|
8909
9226
|
def on_until(node); end
|
8910
9227
|
|
8911
|
-
# source://rubocop/1.
|
9228
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#126
|
8912
9229
|
def on_while(node); end
|
8913
9230
|
|
8914
9231
|
private
|
8915
9232
|
|
8916
|
-
# source://rubocop/1.
|
9233
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#196
|
8917
9234
|
def add_lhs_to_local_variables_scopes(rhs, lhs); end
|
8918
9235
|
|
8919
|
-
# source://rubocop/1.
|
9236
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#204
|
8920
9237
|
def add_masgn_lhs_variables(rhs, lhs); end
|
8921
9238
|
|
8922
|
-
# source://rubocop/1.
|
9239
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#210
|
8923
9240
|
def add_match_var_scopes(in_pattern_node); end
|
8924
9241
|
|
8925
|
-
# source://rubocop/1.
|
9242
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#144
|
8926
9243
|
def add_scope(node, local_variables = T.unsafe(nil)); end
|
8927
9244
|
|
8928
|
-
# source://rubocop/1.
|
9245
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#190
|
8929
9246
|
def allow_self(node); end
|
8930
9247
|
|
8931
|
-
# source://rubocop/1.
|
9248
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#150
|
8932
9249
|
def allowed_send_node?(node); end
|
8933
9250
|
|
8934
|
-
# source://rubocop/1.
|
9251
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#165
|
8935
9252
|
def it_method_in_block?(node); end
|
8936
9253
|
|
8937
|
-
# source://rubocop/1.
|
9254
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#181
|
8938
9255
|
def on_argument(node); end
|
8939
9256
|
|
8940
|
-
# source://rubocop/1.
|
9257
|
+
# source://rubocop/1.65.1/lib/rubocop/cop/style/redundant_self.rb#173
|
8941
9258
|
def regular_method_call?(node); end
|
8942
9259
|
|
8943
9260
|
class << self
|
@@ -8950,15 +9267,27 @@ end
|
|
8950
9267
|
#
|
8951
9268
|
# source://rubocop-rails//lib/rubocop/cop/mixin/target_rails_version.rb#6
|
8952
9269
|
module RuboCop::Cop::TargetRailsVersion
|
8953
|
-
# source://rubocop-rails//lib/rubocop/cop/mixin/target_rails_version.rb#
|
9270
|
+
# source://rubocop-rails//lib/rubocop/cop/mixin/target_rails_version.rb#11
|
8954
9271
|
def minimum_target_rails_version(version); end
|
8955
9272
|
|
8956
9273
|
# @return [Boolean]
|
8957
9274
|
#
|
8958
|
-
# source://rubocop-rails//lib/rubocop/cop/mixin/target_rails_version.rb#
|
9275
|
+
# source://rubocop-rails//lib/rubocop/cop/mixin/target_rails_version.rb#23
|
8959
9276
|
def support_target_rails_version?(version); end
|
8960
9277
|
end
|
8961
9278
|
|
9279
|
+
# Look for `railties` instead of `rails`, to support apps that only use a subset of `rails`
|
9280
|
+
# See https://github.com/rubocop/rubocop/pull/11289
|
9281
|
+
#
|
9282
|
+
# source://rubocop-rails//lib/rubocop/cop/mixin/target_rails_version.rb#39
|
9283
|
+
RuboCop::Cop::TargetRailsVersion::TARGET_GEM_NAME = T.let(T.unsafe(nil), String)
|
9284
|
+
|
9285
|
+
# Informs the base RuboCop gem that it the Rails version is checked via `requires_gem` API,
|
9286
|
+
# without needing to call this `#support_target_rails_version` method.
|
9287
|
+
#
|
9288
|
+
# source://rubocop-rails//lib/rubocop/cop/mixin/target_rails_version.rb#9
|
9289
|
+
RuboCop::Cop::TargetRailsVersion::USES_REQUIRES_GEM_API = T.let(T.unsafe(nil), TrueClass)
|
9290
|
+
|
8962
9291
|
# RuboCop Rails project namespace
|
8963
9292
|
#
|
8964
9293
|
# source://rubocop-rails//lib/rubocop/rails.rb#5
|