Skip to content

Add more break points for long lines#727

Open
gold2718 wants to merge 4 commits intoNCAR:developfrom
gold2718:fix_breaks
Open

Add more break points for long lines#727
gold2718 wants to merge 4 commits intoNCAR:developfrom
gold2718:fix_breaks

Conversation

@gold2718
Copy link
Collaborator

Some long lines are still broken incorrectly

Some long lines are still broken into invalid Fortran. This PR addresses this by adding more non-ID characters to the allowed break points (currently only spaces and commas).

User interface changes?: No

Fixes: TBA

Testing:
test removed:
unit tests:
system tests:
manual testing:

@gold2718
Copy link
Collaborator Author

@climbfuji, The latest Codee failure seems to be a mismatch between the default settings of the FortranWriter class and what Codee expects. Am I seeing that correctly? If so, I suggest we either modify Codee's expectations or the FortranWriter class defaults (e.g., __INDENT, __CONTINUE_INDENT, etc.). Thoughts?

Note, linebreak_test.F90 now compiles with no warnings so this is just a formatting issue.

@gold2718
Copy link
Collaborator Author

Another Codee comment. While I can match most of Codee's formatting expectations by setting __INDENT = 2, __CONTINUE_INDENT = 4, lowercasing CONTAINS, and minimizing the spacing before the continue character, Codee expects spaces around operators. Unfortunately, this defeats the purpose of the test which is how to break lines when spaces are not present.

Ironically, if capgen had been generating Codee-approved Fortran, @jimmielin would never have seen the bug he reported in #724 🤷.

@climbfuji
Copy link
Collaborator

Another Codee comment. While I can match most of Codee's formatting expectations by setting __INDENT = 2, __CONTINUE_INDENT = 4, lowercasing CONTAINS, and minimizing the spacing before the continue character, Codee expects spaces around operators. Unfortunately, this defeats the purpose of the test which is how to break lines when spaces are not present.

Ironically, if capgen had been generating Codee-approved Fortran, @jimmielin would never have seen the bug he reported in #724 🤷.

We had a similar issue with another test (#722; comment #722 (comment)). If you want to preserve formatting for certain parts of the code, you can wrap those lines in

! codee format off
...
! codee format on

See c221aaf

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

try this please

name079, name080, name081, name082, name083, name084, name085, name086, name087, &
name088, name089, name090, name091, name092, name093, name094, name095, name096, &
name097, name098, name099 /)
character(len=7) :: data(100) = (/ 'name000', 'name001', 'name002', 'name003', 'name004', &
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
character(len=7) :: data(100) = (/ 'name000', 'name001', 'name002', 'name003', 'name004', &
! codee format off
character(len=7) :: data(100) = (/ 'name000', 'name001', 'name002', 'name003', 'name004', &

'Cannot read columns_on_task from file'// &
', columns_on_task has no horizontal dimension; columns_on_task is a protected variable'

end subroutine foo
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
end subroutine foo
end subroutine foo
! codee format on

Add missing spaces in host cap (for Codee).
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.

3 participants