Skip to content

Rubocop: Disable Layout/LineContinuationLeadingSpace #20204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bcoles
Copy link
Contributor

@bcoles bcoles commented May 18, 2025

We current have NewCops disabled. Once enabled, the Layout/LineContinuationLeadingSpace rule will be enabled.

This PR disables this rule.

This rule supports enforcing either leading spaces or trailing spaces, but we don't want to mandate use of one over the other.

Sometimes leading whitespace is useful. For example, code such as the following:

      "<SOAP-ENV:Envelope\r\n" \
      " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\r\n" \
      " xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\r\n" \
      " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\r\n" \
      ">\r\n" \

This code would result in the following violations:

modules/exploits/linux/upnp/miniupnpd_soap_bof.rb:154:8: C: [Correctable] Layout/LineContinuationLeadingSpace: Move leading spaces to the end of the previous line.
      " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\r\n" \
       ^
modules/exploits/linux/upnp/miniupnpd_soap_bof.rb:155:8: C: [Correctable] Layout/LineContinuationLeadingSpace: Move leading spaces to the end of the previous line.
      " xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\r\n" \
       ^
modules/exploits/linux/upnp/miniupnpd_soap_bof.rb:156:8: C: [Correctable] Layout/LineContinuationLeadingSpace: Move leading spaces to the end of the previous line.
      " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\r\n" \
       ^
modules/exploits/linux/upnp/miniupnpd_soap_bof.rb:208:8: C: [Correctable] Layout/LineContinuationLeadingSpace: Move leading spaces to the end of the previous line.
      " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\r\n" \
       ^
modules/exploits/linux/upnp/miniupnpd_soap_bof.rb:209:8: C: [Correctable] Layout/LineContinuationLeadingSpace: Move leading spaces to the end of the previous line.
      " xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\r\n" \
       ^
modules/exploits/linux/upnp/miniupnpd_soap_bof.rb:210:8: C: [Correctable] Layout/LineContinuationLeadingSpace: Move leading spaces to the end of the previous line.
      " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\r\n" \
       ^

@bcoles bcoles added the code quality Improving code quality label May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Improving code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant