A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rubocop/rubocop/issues/14128 below:

Allow long fully-qualified namespace strings to exceed max length · Issue #14128 · rubocop/rubocop · GitHub

Is your feature request related to a problem? Please describe.

There's no clear way to divide a long namespace in the middle, if it exceeds max line length:

def foo
  # invoke the normal migration method
  # in oracle envs this should end up calling ActiveRecord::ConnectionAdapters::OracleEnhanced::SchemaStatements::create_table
  yada_yada
end
my_file.rb:3:121: C: Layout/LineLength: Line is too long. [126/120] (https://rubystyle.guide#max-line-length)
Describe the solution you'd like

I propose a new configurable attribute for Layout/LineLength, for example AllowNamespace, to allow a fully-qualified method/module/class namespace to extend past the max line length without triggering an offense. It would work exactly like AllowURI.

Describe alternatives you've considered

The best alternative would probably be to live with it. Long namespaces are not common, and you could split it at a :: without much grief.

Additional context

None.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4