-
Notifications
You must be signed in to change notification settings - Fork 78
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
Lower case variables? #166
Comments
@AlexanderRichert-NOAA. Yes, this works well in fprettify. Use the argument #163 might interest you. |
I am unable to achieve the desired behavior both with the latest pip release (0.3.7) and with the head of master. Uncleaned test code: SUBROUTINE mycode(MYVAR, MYOTHERVAR)
IMPLICIT NONE
REAL :: MYVAR
INTEGER :: MYOTHERVAR
END SUBROUTINE MYCODE Desired output: $ fprettify --case 1 1 1 1 test.F90
subroutine mycode(myvar, myothervar)
implicit none
real :: myvar
integer :: myothervar
end subroutine mycode Actual output (0.3.7 and master): $ fprettify --case 1 1 1 1 test.F90
subroutine mycode(MYVAR, MYOTHERVAR)
implicit none
real :: MYVAR
integer :: MYOTHERVAR
end subroutine MYCODE For what it's worth, I was able to achieve the desired effect by adding a catch-all condition to the if/elif block under |
Oh, then I completely misunderstood, sorry. Though you meant the intrinsics. In my opinion it's better to use the IDE for this, and then I would suggest to use camelCase or snake_case. VSCode has a feature for renaming variables. |
Okay thanks. I'll probably create a separate script or fork fprettify so I can do it CI. Feel free to close this issue if this is not likely to be accepted in fprettify. |
Is there a way to lower case all variable and non-intrinsic function names with fprettify, and if not, could there be? I'm trying to automate our reformatting of Fortran code and this looks very promising-- We have a lot of code with mixed cases and want to automatically change everything to one or the other case without touching comments, quoted strings, etc. If it sounds like the sort of thing that would be acceptable to include, I'd be happy to take a crack at contributing the modification.
The text was updated successfully, but these errors were encountered: