Skip to content
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

Adjustion alignment of parameters and conditional expressions #343

Open
Jules1337dev opened this issue Jul 15, 2024 · 2 comments
Open

Adjustion alignment of parameters and conditional expressions #343

Jules1337dev opened this issue Jul 15, 2024 · 2 comments

Comments

@Jules1337dev
Copy link

Jules1337dev commented Jul 15, 2024

In my company the committed coding standard looks like the following examples:

a method call with one parameter is like this:
method_call( parameter ).

a method call with two or more parameters is like this.

method_call(
  parameter1 = value1
  parameter2 = value2
).

Conditional expressions would look like

data(integer) = cond #(   
  when 1 = 1
  then 1
  else 2
).

a combination would look like this:

method_call(
  parameter1 = value #(
    column = value1
  )
  parameter2 = value2
).

value is formatted as method calls:

data(struc) = value strucType(
  column1 = value1
  column2 = value2
).
data(lv_current_max_attribute_id) = value id(
  t_situation_attributes[ 1 ]-attribute_id optional 
) + 1.

if the line gets to long, another line break will be done:

data(lv_current_max_attribute_id) = id(
  t_situation_attributes[ 
    lines( t_situation_attributes ) 
  ]-attribute_id optional 
) + 1.

i tried many combinations of the rule "align conditional expressions" and "align parameters and components" but there is no possibility to achive the result above as the cleaner have multiple options to format it to the right, but fewer to the bottom :)

Are there plans to enhance those rules, so that above formatting will be possible?

@Root3287
Copy link

Root3287 commented Jul 15, 2024

This is like the conversation in the style guide SAP/styleguides#353.

I am in favour of these changes.

@Jules1337dev
Copy link
Author

@Root3287 yes, you are absolutely right...

I will leave this issue open, to keep the pressure up :P

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

No branches or pull requests

2 participants