Skip to content

Conversation

@benthie
Copy link
Contributor

@benthie benthie commented May 9, 2025

Closes #1456



This is an example of how to configure the option.

Copy link
Collaborator

@JHertz5 JHertz5 Jun 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that you add an example below, like there are for the other settings, to demonstrate how the new setting behaves.

@benthie
Copy link
Contributor Author

benthie commented Jul 6, 2025

Hi @JHertz5 , I first wanted to wait for a feedback on the proposed feature before implementing the test cases. Maybe @jeremiah-c-leary could also comment on whether he thinks this feature makes sense implementing. If we agree that it is desired, I am happy to write the tests and update the documentation accordingly.

@jeremiah-c-leary
Copy link
Owner

Afternoon @benthie and @JHertz5 ,

@benthie, if I understand your feature...you would like conditional indenting on concurrent assignments based on the line length. You mentioned rule concurrent_011 had to be disabled to meet your desired formatting. I'm wondering if that rule should be updated to check for line length.

Maybe @jeremiah-c-leary could also comment on whether he thinks this feature makes sense implementing.

The new feature enhances the existing rule, so I think it is valuable to implement.

I apologize for the late reply, but things have been crazy over here.

Regards,

--Jeremy

@benthie
Copy link
Contributor Author

benthie commented Sep 8, 2025

Hi @jeremiah-c-leary and @JHertz5,

I extended the documentation and examples and added a test.

You mentioned rule concurrent_011 had to be disabled to meet your desired formatting. I'm wondering if that rule should be updated to check for line length.

Rule concurrent_011 has the option new_line_after_assign which currently can either be yes (default), no or ignore. It is executed in phase 1 and concurrent_009 in phase 5. Thus, manually broken lines are realigned with the line of the assignment operator by default by concurrent_011 and never seen "broken" by concurrent_009. For it to work with the new option, concurrent_011 has to be disabled currently.

@jeremiah-c-leary Did you have any particular approach in mind regarding the line length check in concurrent_011? Would that be the first rule besides length_001 to consider the line length? At least I don't know of any other so far.

My ideas are:

  • Linked to Autofix line length violations #616
  • Let's introduce a new value for new_line_after_assign, e.g. autofix_length and assume it is used
  • Scenario 1: assignment on same line as <= and line length okay --> new_line_after_assign = no
    --> no change
  • Scenario 2: assignment on same line as <= and line length exceeded --> new_line_after_assign = yes
    --> break the line
  • Scenario 3: assignment on new line and if moved up then line length okay --> new_line_after_assign = no
    --> move up
  • Scenario 4: assignment on new line and if moved up then line length exceeded --> new_line_after_assign = yes
    --> no change
  • In Scenario 2 and 4 the line length might still be exceed if the assignment is on a new line, which then will be caught by length_001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend rule concurrent_009 for manually broken lines

3 participants