Skip to content

[core] Explicitly name all language versions #4120

@oowekyala

Description

@oowekyala

Is your feature request related to a problem? Please describe.
Some languages have a single language version with the empty string as a name. This is not a problem today but #4059 aims to make --use-version more useful by allowing to explicitly state a version to use for all languages. The goal of this is to have a failsafe in case the version is changed or removed, and to document versions better. This is not possible if versions have empty names.

Describe the solution you'd like
Give an explicit name for all language versions.

Describe alternatives you've considered
#4048 was an alternative to this but doesn't help with the --use-version use case described above, indeed making it worse.

Additional context
See full thread in #4059 (comment)

PMD Language and version mappings

Language Id=Terse Name (Name) Extensions Rules Version(s) in PMD 6 (*default) Proposed Version(s) in PMD 7
apex (Apex) cls, trigger ✔️ 54* 52, 53, 54, 55, 56, 57*
ecmascript (Ecmascript) js ✔️ 3* 3, 5, 6 (alias: ES6, ES2015), 7 (ES2016), 8 (ES2017), 9* (ES2018)
html (HTML) html, htm, xhtml, xht, shtml ✔️ ""* 4, 5*
java (Java) java ✔️ 1.3, 1.4, 1.5, 5, 1.6, 6, 1.7, 7, 1.8, 8, 9, 1.9, 10, 1.10, 11, 12, 13, 14, 15, 16, 17, 18, 18-preview, 19*, 19-preview same
jsp (Java Server Pages) jsp, jspx, jspf, tag ✔️ ""* 2, *3
kotlin (Kotlin) kt, ktm ✔️ n/a - only PMD 7 1.6, 1.7*
modelica (Modelica) mo ✔️ ""* 3.4, 3.5*
plsql (PLSQL) sql, trg, prc, fnc, pld, pls, plh, plb, pck, pks, pkh, pkb, typ, tyb, tps, tpb ✔️ ""* 11g, 12c Release 1 (alias: 12.1), 12c Release 2 (alias 12.2), 18c, 19c, 21c*
text (Plain text) plain-text-file-goo-extension default*
pom (Maven POM) pom ✔️ ""* 4.0.0*
scala (Scala) scala 2.13*, 2.12, 2.11, 2.10 same
swift (Swift) swift (:x:) :heavy_check_mark: n/a (only CPD) 4.2, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7*
vf (Salesforce VisualForce) page, component ✔️ ""* 52, 53, 54, 55, 56, 57*
vm (VM) (=Velocity Template Language) vm ✔️ ""* 2.0, 2.1, 2.2, 2.3*
wsdl (WSDL) wsdl ""* 1.1, 2.0*
xml (XML) xml ✔️ ""* 1.0, 1.1*
xsl (XSL) xsl, xslt ✔️ ""* 1.0, 2.0, 3.0*

PMD Languages that only support CPD

all except "go" are deprecated on PMD 6, as they don't support PMD
They will be/have been deleted in PMD 7

Details
Language Id=Terse Name (Name) Extensions
cpp (C++) h, c, cpp, cxx, cc, C
cs (C#) cs
fortran (Fortran) for, f, f66, f77, f90
go (Golang) go
groovy (Groovy) groovy
matlab (Matlab) m
objectivec (Objective-C) h, m
php (PHP: Hypertext Preprocessor) php, class
python (Python) py
ruby (Ruby) rb, cgi, class
swift (Swift) swift

CPD Languages

Language Id=Terse Name (Name) Extensions
any (Any Language) n/a
apex (Apex) .cls
cpp (C++) .h, .hpp, .hxx, .c, .cpp, .cxx, .cc, .C
cs (C#) .cs
dart (Dart) .dart
ecmascript (JavaScript) .js
fortran (Fortran) .for, .f, .f66, .f77, .f90
gherkin (Gherkin) .feature
go (Go) .go
groovy (Groovy) .groovy
html (HTML) .html
jsp (JSP) .jsp, .jspx, .jspf, .tag
java (Java) .java
kotlin (Kotlin) .kt
lua (Lua) .lua
matlab (Matlab) .m
modelica (Modelica) .mo
objectivec (Objective-C) .h, .m
php (PHP) .php, .class
plsql (PL/SQL) .sql, .trg, .prc, .fnc, .pld, .pls, .plh, .plb, .pck, .pks, .pkh, .pkb, .typ, .tyb, .tps, .tpb
perl (Perl) .pm, .pl, .t
python (Python) .py
ruby (Ruby) .rb, .cgi, .class
scala (Scala) .scala
swift (Swift) .swift
vf (VisualForce) .page, .component
xml (XML) .xml

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rules

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions