feat: sync language extensions and manifest files with analysis CLI#107
feat: sync language extensions and manifest files with analysis CLI#107alerizzo wants to merge 1 commit into
Conversation
Add the extra file extensions and manifest/lock filenames that the analysis CLI's LANGUAGE_CONFIG already recognizes but were missing from this source of truth, so both stay in sync. Extensions: Erlang (.hrl/.es/.escript), Fortran (.f/.for/.f77/.f08), FSharp (.fsi/.fsx), Perl (.pm/.pod/.perl/.t), R (.rd/.rsx), HTML (.htm/.xhtml), Prolog (.pro/.prolog), Lisp (.cl), Scratch (.sb3), Lua (.luau). Files: Erlang (rebar.config/rebar.lock), Elm (elm.json/elm-package.json), FSharp (paket.lock), Perl (cpanfile/cpanfile.snapshot), R (renv.lock/.Rprofile), Julia (Project.toml), OCaml (dune-project). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Code Review
This pull request expands the supported file extensions and configuration/lock files for several programming languages in Language.scala. Feedback suggests adding corresponding unit tests in LanguageSpec.scala to verify that these new extensions and manifest/lock files are correctly resolved.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| case object Erlang | ||
| extends Language(extensions = Set(".erl", ".hrl", ".es", ".escript"), files = Set("rebar.config", "rebar.lock")) |
There was a problem hiding this comment.
While these additions are purely additive and align with the analysis CLI, we should add corresponding unit tests in LanguageSpec.scala to verify that these new extensions (e.g., .escript, .luau, .fsx) and manifest/lock files (e.g., rebar.config, paket.lock, .Rprofile, dune-project) are correctly resolved to their respective languages via Languages.forPath. This ensures correctness and prevents future regressions.
There was a problem hiding this comment.
Pull Request Overview
This PR synchronizes language definitions in Language.scala with the Codacy analysis CLI. The changes are generally consistent with the goal of ensuring the source-of-truth matches the CLI's detection logic. Codacy analysis indicates the code is up to standards.
However, there is a significant implementation gap regarding verification: no updates were made to the test suite (e.g., LanguageSpec) to cover the new extensions and manifest files. Furthermore, two minor gaps were identified in the R and Scratch language objects that should be addressed to ensure full coverage of those languages.
About this PR
- The PR adds a significant number of new language-to-file mappings but does not include any updates to the test suite (e.g.,
LanguageSpec) to verify these new entries. Adding specific unit test cases for these additions is highly recommended to prevent future regressions and ensure the mapping logic works as intended for all 13 updated languages.
Test suggestions
- Verify that the new Erlang extensions (.hrl, .es, .escript) and manifest files (rebar.config, rebar.lock) are correctly associated with the Erlang language object.
- Verify that new Perl extensions (.pm, .pod, .perl, .t) and manifests (cpanfile, cpanfile.snapshot) are correctly mapped.
- Verify that manifest/lock files for FSharp (paket.lock), R (renv.lock, .Rprofile), Julia (Project.toml), OCaml (dune-project), and Elm (elm.json, elm-package.json) are correctly detected.
- Verify that additional extensions for Fortran, HTML, R, Scratch, Lua, Lisp, and Prolog are correctly mapped to their respective languages.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that the new Erlang extensions (.hrl, .es, .escript) and manifest files (rebar.config, rebar.lock) are correctly associated with the Erlang language object.
2. Verify that new Perl extensions (.pm, .pod, .perl, .t) and manifests (cpanfile, cpanfile.snapshot) are correctly mapped.
3. Verify that manifest/lock files for FSharp (paket.lock), R (renv.lock, .Rprofile), Julia (Project.toml), OCaml (dune-project), and Elm (elm.json, elm-package.json) are correctly detected.
4. Verify that additional extensions for Fortran, HTML, R, Scratch, Lua, Lisp, and Prolog are correctly mapped to their respective languages.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| case object Fortran extends Language(extensions = Set(".f90", ".f95", ".f03", ".f", ".for", ".f77", ".f08")) | ||
|
|
||
| case object R extends Language(extensions = Set(".r")) | ||
| case object R extends Language(extensions = Set(".r", ".rd", ".rsx"), files = Set("renv.lock", ".Rprofile")) |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Suggestion: The standard extensions for R are uppercase .R (scripts) and .Rd (documentation). Since other definitions in this file are case-sensitive, these should be included to ensure files are correctly identified.
| case object R extends Language(extensions = Set(".r", ".rd", ".rsx"), files = Set("renv.lock", ".Rprofile")) | |
| case object R extends Language(extensions = Set(".r", ".R", ".Rd", ".rsx"), files = Set("renv.lock", ".Rprofile")) |
| case object R extends Language(extensions = Set(".r", ".rd", ".rsx"), files = Set("renv.lock", ".Rprofile")) | ||
|
|
||
| case object Scratch extends Language(extensions = Set(".scratch", ".sb", ".sprite", ".sb2", ".sprite2")) | ||
| case object Scratch extends Language(extensions = Set(".scratch", ".sb", ".sprite", ".sb2", ".sprite2", ".sb3")) |
There was a problem hiding this comment.
⚪ LOW RISK
Suggestion: Add the .sprite3 extension to maintain consistency with the other Scratch versions supported.
| case object Scratch extends Language(extensions = Set(".scratch", ".sb", ".sprite", ".sb2", ".sprite2", ".sb3")) | |
| case object Scratch extends Language(extensions = Set(".scratch", ".sb", ".sprite", ".sb2", ".sprite2", ".sb3", ".sprite3")) |
What
Adds the file extensions and manifest/lock filenames that the analysis CLI's
LANGUAGE_CONFIGalready recognizes but were missing from this source-of-truthLanguage.scala. Purely additive — no existing extension/file was removed or reassigned, and no extension collides with another language in the set.This closes the gap uncovered while auditing the CLI's language detection against this repo: the CLI had drifted to a slightly richer set of extensions/manifests for a handful of languages. Rather than shrink the CLI, we bring the source of truth up to the same coverage.
Additions
.hrl,.es,.escriptrebar.config,rebar.lock.f,.for,.f77,.f08.fsi,.fsxpaket.lock.pm,.pod,.perl,.tcpanfile,cpanfile.snapshot.rd,.rsxrenv.lock,.Rprofile.htm,.xhtml.pro,.prolog.cl.sb3.luauelm.json,elm-package.jsonProject.tomldune-projectWorth a reviewer's eye
Two extras are broader than a single ecosystem and could be dropped if you'd rather keep this repo conservative:
.t— Perl test files, but.tis also used by other tools (e.g. Terra/Turing)..cl— Common Lisp, but.clalso denotes OpenCL kernels.Neither collides with any other language currently in
Languages.all, solanguageByExtensionstays unambiguous either way.Testing
scalafmtAllapplied.codacy-plugins-apiJVM/testcompiles and passes (LanguageSpec).🤖 Generated with Claude Code