trapd00r / LS_COLORS

A collection of LS_COLORS definitions; needs your contribution!
Other
2.11k stars 260 forks source link

Add extra extensions for Fortran #123

Closed mathomp4 closed 5 years ago

mathomp4 commented 5 years ago

I've added some Fortran extensions. Technically, the .F, .f90, and .F90 are the ones that are important where the capitalized variant is a signal to compilers to preprocess with cpp or fpp before compiling.

No one should use .f95, .f03, and .f08 (and the capitalized variants) but I know some out there that do, so I've added them here. If you would like to delete them, I will not protest. :)

rpdelaney commented 5 years ago

No one should use...

Why?

mathomp4 commented 5 years ago

Steve Lionel, Dr Fortran himself, has a good account here: https://software.intel.com/en-us/blogs/2013/01/11/doctor-fortran-in-source-form-just-wants-to-be-free

.f90 was a good idea to delineate free-format from fixed-format files. The issue as he said was when the Fortran 95 standard came out, people started using .f95, then the Fortran 2003 standard (.f03), Fortran 2008, 2018...

Some say that "well, my .f08 file means it uses Fortran 2008 features" but that'd be like using .c18 for C18 standard files and no one in C land does that. (right?) I don't think any modern Fortran compiler nowadays that cares about the extension beyond .f means fixed-format and .f90 and all others as free-format. (Intel's compiler doesn't consider non-.f90 as a Fortran file I think.)

I always thought .fortran should be the extension for "modern" Fortran. It's not like ye olde 8.3 is needed anymore (.html, .docx, heck, .numbers for Numbers files!). But then one thinks about the convention that "capital means do the pre-processing first", and should that be .Fortran or .FORTRAN and I sort of shrug and move along. :)

But, I've seen a few .f95, .f03, and even some .f08 files in my time, so I added them to the LS_COLORS file. Never a .f18 yet but I'm sure it's coming.

rpdelaney commented 5 years ago

I'm inclined to say we should style all the things. For instance, if you cloned someone else's package and they used the extensions you think they shouldn't, wouldn't you want them to be colored anyway?

If I'm reading you right, that's what you've done. Right?

mathomp4 commented 5 years ago

@rpdelaney Yes, that's why I included them all. No one should ever have a file ending in those, but if they do, they are Fortran, so let's color them like a Fortran file.

rpdelaney commented 5 years ago

Thanks!