Skip to content

Expand Fortran file-extension support #1563

Open

Description

@huxs001

The built-in Fortran extension table in src/discover/language.c currently recognizes only:

.f03
.f08
.f90
.f95

This misses several commonly used Fortran extensions, especially in scientific and HPC codebases.

Please expand the Fortran entries to include:

.f
.F
.for
.f77
.fpp
.f90
.f95
.f03
.f08

In particular, .F is important for preprocessed Fortran source files. For example, CP2K uses .F extensively in its source tree:

https://github.com/cp2k/cp2k/tree/master/src

The uppercase .F extension is intentional: in many Fortran build systems it distinguishes source files that are passed through the C preprocessor from ordinary .f/.f90 sources.

Requested change

Update the Fortran section of src/discover/language.c to recognize at least:

/* Fortran */
{".f",   CBM_LANG_FORTRAN},
{".F",   CBM_LANG_FORTRAN},
{".for", CBM_LANG_FORTRAN},
{".f77", CBM_LANG_FORTRAN},
{".fpp", CBM_LANG_FORTRAN},
{".f90", CBM_LANG_FORTRAN},
{".f95", CBM_LANG_FORTRAN},
{".f03", CBM_LANG_FORTRAN},
{".f08", CBM_LANG_FORTRAN},

Please also add or update tests covering these extensions.

Reference: CP2K source tree, which contains extensive use of preprocessed .F Fortran sources:

https://github.com/cp2k/cp2k/tree/master/src

Activity

  1. added
    enhancementNew feature or request
    language-requestRequest for new language support
    parsing/qualityGraph extraction bugs, false positives, missing edges
    priority/normalStandard review queue; useful PR with ordinary maintainer urgency.
    on Aug 12, 2026
  2. DeusData commented on Aug 12, 2026

    @DeusData
    Owner

    Thank you @huxs001. Confirmed on current main: the built-in Fortran table contains only .f03, .f08, .f90, and .f95. Extension matching uses strcmp, so uppercase .F must be listed explicitly and cannot be covered by lowercase .f.

    Routed as a normal-priority language coverage enhancement under #592, including tests for the fixed-form and preprocessed suffixes you listed.

  3. DeusData commented on Oct 19, 2026

    @DeusData
    Owner

    Thank you again for the Fortran extension examples, particularly uppercase .F in preprocessed sources. I do not have a new implementation result to report; the requested suffix coverage remains recorded here, with no additional examples needed now.

  4. DeusData commented on Oct 25, 2026

    @DeusData
    Owner

    Thank you for the Fortran suffix examples, including uppercase .F. The requested discovery coverage remains outstanding; no more examples are needed. Sorry for the delay; this is waiting on maintainer follow-up, and I’ll follow up soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlanguage-requestRequest for new language supportparsing/qualityGraph extraction bugs, false positives, missing edgespriority/normalStandard review queue; useful PR with ordinary maintainer urgency.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions