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

missing split of elseif to else if #179

Open
nbehrnd opened this issue Jan 7, 2025 · 0 comments
Open

missing split of elseif to else if #179

nbehrnd opened this issue Jan 7, 2025 · 0 comments

Comments

@nbehrnd
Copy link

nbehrnd commented Jan 7, 2025

It seems to me fprettify does not provide an automated edit of keyword elseif to yield else if.

Inspired by a discussion in the fortitude project (link) I observe fprettify (version 0.3.7, fetched from PyPI) apparently doesn't edit elseif while e.g., endif and enddo routinely yield end if and end do, respectively.

My test file:

! test.f90
program test
   implicit none
   integer :: i
   do i = 1, 8
      if (i == 3) then
         print *, "first branch"
      elseif (i == 4) then
         print *, "second branch"
      endif
   enddo
end program test

Tests run:

  • fprettify test.f90, i.e. default parameters: endif and enddo are split, elseif remains elseif
  • fprettify --whitespace-intrinsics False test.f90: as expected, endif and enddo are equally retained as such
  • fprettify --whitespace-intrinsics True test.f90: endif and enddo are edited, but elseif is not
  • fprettify --whitespace-logical True test.f90: endif and enddo are edited, but elseif is not

Is there a different flag or level more suitable for the task I should use instead?

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

1 participant