diff --git a/.all-contributorsrc b/.all-contributorsrc index 77965bd302..41116fe796 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3267,7 +3267,8 @@ "avatar_url": "https://avatars.githubusercontent.com/u/24591067?v=4", "profile": "https://github.com/jborgers", "contributions": [ - "bug" + "bug", + "code" ] }, { @@ -6730,6 +6731,33 @@ "contributions": [ "bug" ] + }, + { + "login": "stokpop", + "name": "Peter Paul Bakker", + "avatar_url": "https://avatars.githubusercontent.com/u/8797018?v=4", + "profile": "https://www.stokpop.nl/", + "contributions": [ + "code" + ] + }, + { + "login": "ASBrouwers", + "name": "ASBrouwers", + "avatar_url": "https://avatars.githubusercontent.com/u/23551289?v=4", + "profile": "https://github.com/ASBrouwers", + "contributions": [ + "code" + ] + }, + { + "login": "341816041", + "name": "่Œ…ๅปถๅฎ‰", + "avatar_url": "https://avatars.githubusercontent.com/u/100549608?v=4", + "profile": "https://github.com/341816041", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/docs/_data/sidebars/pmd_sidebar.yml b/docs/_data/sidebars/pmd_sidebar.yml index 2680579b33..8d72847030 100644 --- a/docs/_data/sidebars/pmd_sidebar.yml +++ b/docs/_data/sidebars/pmd_sidebar.yml @@ -412,6 +412,9 @@ entries: - title: HTML url: /pmd_languages_html.html output: web, pdf + - title: Gherkin + url: /pmd_languages_gherkin.html + output: web, pdf - title: Developer Documentation output: web, pdf folderitems: diff --git a/docs/pages/pmd/languages/gherkin.md b/docs/pages/pmd/languages/gherkin.md new file mode 100644 index 0000000000..123bae7d49 --- /dev/null +++ b/docs/pages/pmd/languages/gherkin.md @@ -0,0 +1,16 @@ +--- +title: Gherkin +permalink: pmd_languages_gherkin.html +--- + +The [Gherkin](https://cucumber.io/docs/gherkin/) language is used to define test cases for the +[Cucumber](https://cucumber.io/) testing tool for behavior-driven development. +The Gherkin syntax is designed to be non-technical, making it human-readable for a wide audience. + +## Support in PMD +Starting from version 6.48.0, Gherkin support was added to CPD. + +### Limitations +- Support for Gherkin only extends to CPD to detect code duplication in Cucumber test cases. +- While Gherkin keywords have been translated into various +languages, CPD currently supports only the English version of the Gherkin language. diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index 8f1893b2dd..9238b38248 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -17,946 +17,951 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
0xflotus

๐Ÿ’ป ๐Ÿ›
1henni

๐Ÿ›
ALiNew

๐Ÿ› +
ASBrouwers

๐Ÿ’ป
Abhijit Sarkar

๐Ÿ›
Abhishek Kumar

๐Ÿ›
Adam

๐Ÿ› -
Adam Carroll

๐Ÿ› +
Adam Carroll

๐Ÿ›
Adam Obuchowicz

๐Ÿ›
Adrian Price

๐Ÿ›
Adrien Lecharpentier

๐Ÿ›
Aidan Harding

๐Ÿ›
Akshat Bahety

๐Ÿ’ป ๐Ÿ›
Akshay Thapa

๐Ÿ› -
Alan Buttars

๐Ÿ› +
Alan Buttars

๐Ÿ›
Alan Hohn

๐Ÿ›
Alberto Fernรกndez

๐Ÿ’ป ๐Ÿ›
Alex Rentz

๐Ÿ›
Alex Saveau

๐Ÿ›
Alex Shesterov

๐Ÿ’ป ๐Ÿ›
Alexey Markevich

๐Ÿ› -
Alexey Naumov

๐Ÿ› +
Alexey Naumov

๐Ÿ›
Alexey Yudichev

๐Ÿ›
Alix

๐Ÿ›
Alix

๐Ÿ›
Amish Shah

๐Ÿ›
Amit Prasad

๐Ÿ›
Amitosh Swain Mahapatra

๐Ÿ› -
Anand Subramanian

๐Ÿ’ป ๐Ÿ› +
Anand Subramanian

๐Ÿ’ป ๐Ÿ›
Anatoly Trosinenko

๐Ÿ’ป ๐Ÿ›
Andi Pabst

๐Ÿ’ป ๐Ÿ›
Andrea

๐Ÿ›
Andrea Aime

๐Ÿ›
Andreas Dangel

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› ๐Ÿšง
Andreas Markussen

๐Ÿ› -
Andreas Schmid

๐Ÿ› +
Andreas Schmid

๐Ÿ›
Andreas Turban

๐Ÿ›
Andrei Paikin

๐Ÿ›
Andrew

๐Ÿ›
Andrew Green

๐Ÿ›
Andrey Fomin

๐Ÿ›
Andrey Hitrin

๐Ÿ› -
Andrey Mochalov

๐Ÿ’ป ๐Ÿ› +
Andrey Mochalov

๐Ÿ’ป ๐Ÿ›
Andro72

๐Ÿ›
Andrwyw

๐Ÿ›
Andrรฉs Catalรกn

๐Ÿ›
Andy Pattenden

๐Ÿ›
Andy Ray

๐Ÿ›
Andy Robinson

๐Ÿ› -
Andy-2639

๐Ÿ› +
Andy-2639

๐Ÿ›
Ankush Somani

๐Ÿ›
Anmol Kumar

๐Ÿ›
Anthony Whitford

๐Ÿ›
AnthonyKot

๐Ÿ›
Aravind Hegde

๐Ÿ›
Arda Aslan

๐Ÿ› -
Ari Fogel

๐Ÿ› +
Ari Fogel

๐Ÿ›
Arnaud Jeansen

๐Ÿ’ป ๐Ÿ›
Arpit Koolwal

๐Ÿ›
Artem

๐Ÿ’ป ๐Ÿ›
Artem

๐Ÿ›
Artem Sheremet

๐Ÿ›
Artur

๐Ÿ› -
Artur Bosch

๐Ÿ› +
Artur Bosch

๐Ÿ›
Artur Dryomov

๐Ÿ›
Artur Ossowski

๐Ÿ›
AshTheMash

๐Ÿ›
Ashish Rana

๐Ÿ›
Atul Kaushal

๐Ÿ›
August Boland

๐Ÿ› -
Aurel Hudec

๐Ÿ› +
Aurel Hudec

๐Ÿ›
Austin Shalit

๐Ÿ›
Austin Tice

๐Ÿ›
Ayoub Kaanich

๐Ÿ›
BBG

๐Ÿ’ป ๐Ÿ“– ๐Ÿ›
Bailey Tjiong

๐Ÿ’ป
Barthรฉlemy L.

๐Ÿ› -
Basavaraj K N

๐Ÿ› +
Basavaraj K N

๐Ÿ›
Basil Peace

๐Ÿ›
Belle

๐Ÿ›
Ben Lerner

๐Ÿ›
Ben Manes

๐Ÿ›
Ben McCann

๐Ÿ›
Bendegรบz Nagy

๐Ÿ› -
Bennet S Yee

๐Ÿ› +
Bennet S Yee

๐Ÿ›
Benoit Lacelle

๐Ÿ›
Bernardo Macรชdo

๐Ÿ›
Bernd Farka

๐Ÿ›
Betina Cynthia Mamani

๐Ÿ›
Bhanu Prakash Pamidi

๐Ÿ’ป ๐Ÿ›
Bhargav Thanki

๐Ÿ› -
Binu R J

๐Ÿ› +
Binu R J

๐Ÿ›
Bjรถrn Kautler

๐Ÿ’ป ๐Ÿ›
Blightbuster

๐Ÿ›
Bo Zhang

๐Ÿ›
Bob "Wombat" Hogg

๐Ÿ›
Bobby Wertman

๐Ÿ›
Bolarinwa Saheed Olayemi

๐Ÿ’ป ๐Ÿ› -
Boris Petrov

๐Ÿ› +
Boris Petrov

๐Ÿ›
Brad Kent

๐Ÿ›
Brandon Mikeska

๐Ÿ›
Brian Batronis

๐Ÿ›
Brian Johnson

๐Ÿ›
Brice Dutheil

๐Ÿ’ป ๐Ÿ›
Bruno Ferreira

๐Ÿ› -
Bruno Ritz

๐Ÿ› +
Bruno Ritz

๐Ÿ›
Cameron Donaldson

๐Ÿ›
Carlos Macasaet

๐Ÿ›
Carsten Otto

๐Ÿ›
Charlie Housh

๐Ÿ›
Charlie Jonas

๐Ÿ›
Chas Honton

๐Ÿ› -
Chen Yang

๐Ÿ› +
Chen Yang

๐Ÿ›
Chotu

๐Ÿ›
Chris Smith

๐Ÿ›
Christian Hujer

๐Ÿ›
Christian Pontesegger

๐Ÿ›
ChristianWulf

๐Ÿ›
Christofer Dutz

๐Ÿ’ป -
Christoffer Anselm

๐Ÿ› +
Christoffer Anselm

๐Ÿ›
Christophe Vidal

๐Ÿ›
Christopher Dancy

๐Ÿ›
Clemens Prill

๐Ÿ›
Clint Chester

๐Ÿ’ป ๐Ÿ›
Clรฉment Fournier

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› ๐Ÿšง
Codacy Badger

๐Ÿ› -
Code-Nil

๐Ÿ› +
Code-Nil

๐Ÿ›
ColColonCleaner

๐Ÿ›
Colin Ingarfield

๐Ÿ›
Craig Andrews

๐Ÿ›
Craig Muchinsky

๐Ÿ›
Cyril

๐Ÿ’ป ๐Ÿ›
Dale

๐Ÿ’ป -
Damien Jiang

๐Ÿ› +
Damien Jiang

๐Ÿ›
Dan Berindei

๐Ÿ›
Dan Rollo

๐Ÿ›
Dan Ziemba

๐Ÿ›
Daniel Gredler

๐Ÿ’ป
Daniel Jipa

๐Ÿ›
Daniel Paul Searles

๐Ÿ’ป -
Daniel Reigada

๐Ÿ› +
Daniel Reigada

๐Ÿ›
Danilo Pianini

๐Ÿ›
Darko

๐Ÿ›
David

๐Ÿ›
David Atkinson

๐Ÿ›
David Burstrรถm

๐Ÿ’ป ๐Ÿ›
David Goatรฉ

๐Ÿ› -
David Golpira

๐Ÿ› +
David Golpira

๐Ÿ›
David Kovaล™รญk

๐Ÿ›
David M. Karr (fullname at gmail.com)

๐Ÿ›
David Renz

๐Ÿ’ป ๐Ÿ›
David Renz

๐Ÿ›
Deleted user

๐Ÿ›
Dell Green

๐Ÿ› -
Dem Pilafian

๐Ÿ› +
Dem Pilafian

๐Ÿ›
Den

๐Ÿ›
Denis Borovikov

๐Ÿ’ป ๐Ÿ›
Dennie Reniers

๐Ÿ’ป ๐Ÿ›
Dennis Kieselhorst

๐Ÿ›
Derek P. Moore

๐Ÿ›
Dichotomia

๐Ÿ› -
Dionisio Cortรฉs Fernรกndez

๐Ÿ’ป ๐Ÿ› +
Dionisio Cortรฉs Fernรกndez

๐Ÿ’ป ๐Ÿ›
Dmitri Bourlatchkov

๐Ÿ›
Dmitriy Kuzmin

๐Ÿ›
Dmytro Dashenkov

๐Ÿ›
Drew Hall

๐Ÿ›
Dumitru Postoronca

๐Ÿ›
Dylan Adams

๐Ÿ› -
Eden Hao

๐Ÿ› +
Eden Hao

๐Ÿ›
Egor Bredikhin

๐Ÿ›
Elan P. Kugelmass

๐Ÿ›
Elder S.

๐Ÿ›
Emile

๐Ÿ›
Eric

๐Ÿ›
Eric Kintzer

๐Ÿ› -
Eric Perret

๐Ÿ› +
Eric Perret

๐Ÿ›
Eric Squires

๐Ÿ›
Erich L Foster

๐Ÿ›
Erik Bleske

๐Ÿ›
Ernst Reissner

๐Ÿ›
F.W. Dekker

๐Ÿ›
FSchliephacke

๐Ÿ› -
Facundo

๐Ÿ› +
Facundo

๐Ÿ›
Federico Giust

๐Ÿ›
Fedor Sherstobitov

๐Ÿ›
Felix Lampe

๐Ÿ›
Filip Golonka

๐Ÿ›
Filipe Esperandio

๐Ÿ’ป ๐Ÿ›
Filippo Nova

๐Ÿ› -
Francesco la Torre

๐Ÿ› +
Francesco la Torre

๐Ÿ›
Francisco Duarte

๐Ÿ›
Frieder Bluemle

๐Ÿ›
Frits Jalvingh

๐Ÿ’ป ๐Ÿ›
G. Bazior

๐Ÿ›
Gabe Henkes

๐Ÿ›
Genoud Magloire

๐Ÿ› -
Geoffrey555

๐Ÿ› +
Geoffrey555

๐Ÿ›
Georg Romstorfer

๐Ÿ›
Gio

๐Ÿ›
Gol

๐Ÿ›
Gonzalo Exequiel Ibars Ingman

๐Ÿ’ป ๐Ÿ›
GooDer

๐Ÿ›
Gregor Riegler

๐Ÿ› -
Grzegorz Olszewski

๐Ÿ› +
Grzegorz Olszewski

๐Ÿ›
Gunther Schrijvers

๐Ÿ’ป ๐Ÿ›
Gustavo Krieger

๐Ÿ›
Guy Elsmore-Paddock

๐Ÿ›
Gรถrkem Mรผlayim

๐Ÿ›
Hanzel Godinez

๐Ÿ›
Haoliang Chen

๐Ÿ› -
Harsh Kukreja

๐Ÿ› +
Harsh Kukreja

๐Ÿ›
Heber

๐Ÿ›
Henning Schmiedehausen

๐Ÿ’ป ๐Ÿ›
Henning von Bargen

๐Ÿ’ป
Hervรฉ Boutemy

๐Ÿ›
Himanshu Pandey

๐Ÿ›
Hokwang Lee

๐Ÿ› -
Hooperbloob

๐Ÿ’ป +
Hooperbloob

๐Ÿ’ป
Hung PHAN

๐Ÿ›
IDoCodingStuffs

๐Ÿ’ป ๐Ÿ›
Iccen Gan

๐Ÿ›
Ignacio Mariano Tirabasso

๐Ÿ›
Igor Melnichenko

๐Ÿ›
Igor Moreno

๐Ÿ› -
Intelesis-MS

๐Ÿ› +
Intelesis-MS

๐Ÿ›
Iroha_

๐Ÿ›
Ishan Srivastava

๐Ÿ›
Ivano Guerini

๐Ÿ›
Ivar Andreas Bonsaksen

๐Ÿ›
Ivo ล mรญd

๐Ÿ›
JJengility

๐Ÿ› -
Jake Hemmerle

๐Ÿ› +
Jake Hemmerle

๐Ÿ›
James Harrison

๐Ÿ› ๐Ÿ’ป
Jan

๐Ÿ›
Jan Aertgeerts

๐Ÿ’ป ๐Ÿ›
Jan Brรผmmer

๐Ÿ›
Jan Tล™รญska

๐Ÿ›
Jan-Lukas Else

๐Ÿ› -
Jason Qiu

๐Ÿ’ป ๐Ÿ“– +
Jason Qiu

๐Ÿ’ป ๐Ÿ“–
Jason Williams

๐Ÿ›
Jean-Paul Mayer

๐Ÿ›
Jean-Simon Larochelle

๐Ÿ›
Jeff Bartolotta

๐Ÿ’ป ๐Ÿ›
Jeff Hube

๐Ÿ’ป ๐Ÿ›
Jeff Jensen

๐Ÿ› -
Jeff May

๐Ÿ› +
Jeff May

๐Ÿ›
Jens Gerdes

๐Ÿ› -
Jeroen Borgers

๐Ÿ› +
Jeroen Borgers

๐Ÿ› ๐Ÿ’ป
Jerome Russ

๐Ÿ›
JerritEic

๐Ÿ’ป ๐Ÿ“–
Jiri Pejchal

๐Ÿ›
Jithin Sunny

๐Ÿ› -
Jiล™รญ ล korpil

๐Ÿ› +
Jiล™รญ ล korpil

๐Ÿ›
Joao Machado

๐Ÿ›
Jochen Krauss

๐Ÿ›
Johan Hammar

๐Ÿ›
John Karp

๐Ÿ›
John Zhang

๐Ÿ›
John-Teng

๐Ÿ’ป ๐Ÿ› -
Jon Moroney

๐Ÿ’ป ๐Ÿ› +
Jon Moroney

๐Ÿ’ป ๐Ÿ›
Jonas Geiregat

๐Ÿ›
Jonathan Wiesel

๐Ÿ’ป ๐Ÿ›
Jordan

๐Ÿ›
Jordi Llach

๐Ÿ›
Jorge Solรณrzano

๐Ÿ›
JorneVL

๐Ÿ› -
Jose Palafox

๐Ÿ› +
Jose Palafox

๐Ÿ›
Jose Stovall

๐Ÿ›
Joseph

๐Ÿ’ป
Joseph Heenan

๐Ÿ›
Josh Feingold

๐Ÿ’ป ๐Ÿ›
Josh Holthaus

๐Ÿ›
Joshua S Arquilevich

๐Ÿ› -
Joรฃo Ferreira

๐Ÿ’ป ๐Ÿ› +
Joรฃo Ferreira

๐Ÿ’ป ๐Ÿ›
Joรฃo Pedro Schmitt

๐Ÿ›
Juan Martรญn Sotuyo Dodero

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› ๐Ÿšง
Juan Pablo Civile

๐Ÿ›
Julian Voronetsky

๐Ÿ›
Julien

๐Ÿ›
Julius

๐Ÿ› -
JustPRV

๐Ÿ› +
JustPRV

๐Ÿ›
Jรถrn Huxhorn

๐Ÿ›
KThompso

๐Ÿ›
Kai Amundsen

๐Ÿ›
Karel Vervaeke

๐Ÿ›
Karl-Andero Mere

๐Ÿ›
Karl-Philipp Richter

๐Ÿ› -
Karsten Silz

๐Ÿ› +
Karsten Silz

๐Ÿ›
Kazuma Watanabe

๐Ÿ›
Kev

๐Ÿ›
Keve Mรผller

๐Ÿ›
Kevin Guerra

๐Ÿ’ป
Kevin Jones

๐Ÿ›
Kevin Wayne

๐Ÿ› -
Kieran Black

๐Ÿ› +
Kieran Black

๐Ÿ›
Kirill Zubov

๐Ÿ›
Kirk Clemens

๐Ÿ’ป ๐Ÿ›
Klaus Hartl

๐Ÿ›
Koen Van Looveren

๐Ÿ›
Kris Scheibe

๐Ÿ’ป ๐Ÿ›
Kunal Thanki

๐Ÿ› -
LaLucid

๐Ÿ’ป +
LaLucid

๐Ÿ’ป
Larry Diamond

๐Ÿ’ป ๐Ÿ›
Lars Knickrehm

๐Ÿ›
Leo Gutierrez

๐Ÿ›
LiGaOg

๐Ÿ’ป
Lintsi

๐Ÿ›
Linus Fernandes

๐Ÿ› -
Lixon Lookose

๐Ÿ› +
Lixon Lookose

๐Ÿ›
Logesh

๐Ÿ›
Lorenzo Gabriele

๐Ÿ›
Loรฏc Ledoyen

๐Ÿ›
Lucas Silva

๐Ÿ›
Lucas Soncini

๐Ÿ’ป ๐Ÿ›
Lukasz Slonina

๐Ÿ› -
Lukebray

๐Ÿ› +
Lukebray

๐Ÿ›
Lyor Goldstein

๐Ÿ›
MCMicS

๐Ÿ›
Macarse

๐Ÿ›
Machine account for PMD

๐Ÿ’ป
Maciek Siemczyk

๐Ÿ›
Maikel Steneker

๐Ÿ’ป ๐Ÿ› -
Maksim Moiseikin

๐Ÿ› +
Maksim Moiseikin

๐Ÿ›
Manfred Koch

๐Ÿ›
Manuel Moya Ferrer

๐Ÿ’ป ๐Ÿ›
Manuel Ryan

๐Ÿ›
Marat Vyshegorodtsev

๐Ÿ›
Marcel Hรคrle

๐Ÿ›
Marcello Fialho

๐Ÿ› -
Marcin Rataj

๐Ÿ› +
Marcin Rataj

๐Ÿ›
Mark Adamcin

๐Ÿ›
Mark Hall

๐Ÿ’ป ๐Ÿ›
Mark Kolich

๐Ÿ›
Mark Pritchard

๐Ÿ›
Markus Rathgeb

๐Ÿ›
Marquis Wang

๐Ÿ› -
Martin Feldsztejn

๐Ÿ› +
Martin Feldsztejn

๐Ÿ›
Martin Lehmann

๐Ÿ›
Martin Spamer

๐Ÿ›
Martin Tarjรกnyi

๐Ÿ›
MatFl

๐Ÿ›
Mateusz Stefanski

๐Ÿ›
Mathieu Gouin

๐Ÿ› -
MatiasComercio

๐Ÿ’ป ๐Ÿ› +
MatiasComercio

๐Ÿ’ป ๐Ÿ›
Matt Benson

๐Ÿ›
Matt De Poorter

๐Ÿ›
Matt Harrah

๐Ÿ›
Matt Nelson

๐Ÿ›
Matthew Amos

๐Ÿ›
Matthew Duggan

๐Ÿ› -
Matthew Hall

๐Ÿ› +
Matthew Hall

๐Ÿ›
Matรญas Fraga

๐Ÿ’ป ๐Ÿ›
Maxime Robert

๐Ÿ’ป ๐Ÿ›
MetaBF

๐Ÿ›
Michael

๐Ÿ›
Michael Bell

๐Ÿ›
Michael Bernstein

๐Ÿ› -
Michael Clay

๐Ÿ› +
Michael Clay

๐Ÿ›
Michael Dombrowski

๐Ÿ›
Michael Hausegger

๐Ÿ›
Michael Hoefer

๐Ÿ›
Michael Mรถbius

๐Ÿ›
Michael N. Lipp

๐Ÿ›
Michael Pellegrini

๐Ÿ› -
Michal Kordas

๐Ÿ› +
Michal Kordas

๐Ÿ›
Michaล‚ Borek

๐Ÿ›
Michaล‚ Kuliล„ski

๐Ÿ›
Miguel Nรบรฑez Dรญaz-Montes

๐Ÿ›
Mihai Ionut

๐Ÿ›
Mirek Hankus

๐Ÿ›
Mladjan Gadzic

๐Ÿ› -
MrAngry52

๐Ÿ› +
MrAngry52

๐Ÿ›
Muminur Choudhury

๐Ÿ›
Mykhailo Palahuta

๐Ÿ’ป ๐Ÿ›
Nagendra Kumar Singh

๐Ÿ›
Nahuel Barrios

๐Ÿ›
Nathan Braun

๐Ÿ›
Nathan Reynolds

๐Ÿ› -
Nathan Reynolds

๐Ÿ› +
Nathan Reynolds

๐Ÿ›
Nathanaรซl

๐Ÿ›
Naveen

๐Ÿ’ป
Nazdravi

๐Ÿ›
Neha-Dhonde

๐Ÿ›
Nicholas Doyle

๐Ÿ›
Nick Butcher

๐Ÿ› -
Nico Gallinal

๐Ÿ› +
Nico Gallinal

๐Ÿ›
Nicola Dal Maso

๐Ÿ›
Nicolas Filotto

๐Ÿ’ป
Nikita Chursin

๐Ÿ›
Niklas Baudy

๐Ÿ›
Nikolas Havrikov

๐Ÿ›
Nilesh Virkar

๐Ÿ› -
Nimit Patel

๐Ÿ› +
Nimit Patel

๐Ÿ›
Niranjan Harpale

๐Ÿ›
Noah Sussman

๐Ÿ›
Noah0120

๐Ÿ›
Noam Tamim

๐Ÿ›
Noel Grandin

๐Ÿ›
Olaf Haalstra

๐Ÿ› -
Oleg Pavlenko

๐Ÿ› +
Oleg Pavlenko

๐Ÿ›
Oleksii Dykov

๐Ÿ’ป
Oliver Eikemeier

๐Ÿ›
Olivier Parent

๐Ÿ’ป ๐Ÿ›
Ollie Abbey

๐Ÿ’ป ๐Ÿ›
OverDrone

๐Ÿ›
Ozan Gulle

๐Ÿ’ป ๐Ÿ› -
PUNEET JAIN

๐Ÿ› +
PUNEET JAIN

๐Ÿ›
Parbati Bose

๐Ÿ›
Paul Berg

๐Ÿ›
Pavel Bludov

๐Ÿ›
Pavel Miฤka

๐Ÿ›
Pedro Nuno Santos

๐Ÿ›
Pedro Rijo

๐Ÿ› -
Pelisse Romain

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› +
Pelisse Romain

๐Ÿ’ป ๐Ÿ“– ๐Ÿ›
Per Abich

๐Ÿ’ป
Pete Davids

๐Ÿ›
Peter Bruin

๐Ÿ›
Peter Chittum

๐Ÿ’ป ๐Ÿ›
Peter Cudmore

๐Ÿ›
Peter Kasson

๐Ÿ› -
Peter Kofler

๐Ÿ› +
Peter Kofler

๐Ÿ› +
Peter Paul Bakker

๐Ÿ’ป
Pham Hai Trung

๐Ÿ›
Philip Graf

๐Ÿ’ป ๐Ÿ›
Philip Hachey

๐Ÿ›
Philippe Ozil

๐Ÿ›
Phinehas Artemix

๐Ÿ› -
Phokham Nonava

๐Ÿ› -
Piotr Szymaล„ski

๐Ÿ› +
Phokham Nonava

๐Ÿ› +
Piotr Szymaล„ski

๐Ÿ›
Piotrek ลปygieล‚o

๐Ÿ’ป ๐Ÿ›
Pranay Jaiswal

๐Ÿ›
Prasad Kamath

๐Ÿ›
Prasanna

๐Ÿ›
Presh-AR

๐Ÿ› -
Puneet1726

๐Ÿ› -
Rafael Cortรชs

๐Ÿ› +
Puneet1726

๐Ÿ› +
Rafael Cortรชs

๐Ÿ›
RaheemShaik999

๐Ÿ›
RajeshR

๐Ÿ’ป ๐Ÿ›
Ramachandra Mohan

๐Ÿ›
Ramel0921

๐Ÿ›
Raquel Pau

๐Ÿ› -
Ravikiran Janardhana

๐Ÿ› -
Reda Benhemmouche

๐Ÿ› +
Ravikiran Janardhana

๐Ÿ› +
Reda Benhemmouche

๐Ÿ›
Renato Oliveira

๐Ÿ’ป ๐Ÿ›
Rich DiCroce

๐Ÿ›
Riot R1cket

๐Ÿ›
Rishabh Jain

๐Ÿ›
RishabhDeep Singh

๐Ÿ› -
Robbie Martinus

๐Ÿ’ป ๐Ÿ› -
Robert Henry

๐Ÿ› +
Robbie Martinus

๐Ÿ’ป ๐Ÿ› +
Robert Henry

๐Ÿ›
Robert Painsi

๐Ÿ›
Robert Russell

๐Ÿ›
Robert Sรถsemann

๐Ÿ’ป ๐Ÿ“– ๐Ÿ“ข ๐Ÿ›
Robert Whitebit

๐Ÿ›
Robin Richtsfeld

๐Ÿ› -
Robin Stocker

๐Ÿ’ป ๐Ÿ› -
Robin Wils

๐Ÿ› +
Robin Stocker

๐Ÿ’ป ๐Ÿ› +
Robin Wils

๐Ÿ›
RochusOest

๐Ÿ›
Rodolfo Noviski

๐Ÿ›
Rodrigo Casara

๐Ÿ›
Rodrigo Fernandes

๐Ÿ›
Roman Salvador

๐Ÿ’ป ๐Ÿ› -
Ronald Blaschke

๐Ÿ› -
Rรณbert Papp

๐Ÿ› +
Ronald Blaschke

๐Ÿ› +
Rรณbert Papp

๐Ÿ›
Saikat Sengupta

๐Ÿ›
Saksham Handu

๐Ÿ›
Saladoc

๐Ÿ›
Salesforce Bob Lightning

๐Ÿ›
Sam Carlberg

๐Ÿ› -
Satoshi Kubo

๐Ÿ› -
Scott Kennedy

๐Ÿ› +
Satoshi Kubo

๐Ÿ› +
Scott Kennedy

๐Ÿ›
Scott Wells

๐Ÿ› ๐Ÿ’ป
Scrsloota

๐Ÿ’ป
Sebastian Bรถgl

๐Ÿ›
Sebastian Schuberth

๐Ÿ›
Sebastian Schwarz

๐Ÿ› -
Sergey Gorbaty

๐Ÿ› -
Sergey Kozlov

๐Ÿ› +
Sergey Gorbaty

๐Ÿ› +
Sergey Kozlov

๐Ÿ›
Sergey Yanzin

๐Ÿ’ป ๐Ÿ›
Seth Wilcox

๐Ÿ’ป
Shubham

๐Ÿ’ป ๐Ÿ›
Simon Xiao

๐Ÿ›
Srinivasan Venkatachalam

๐Ÿ› -
Stanislav Gromov

๐Ÿ› -
Stanislav Myachenkov

๐Ÿ’ป +
Stanislav Gromov

๐Ÿ› +
Stanislav Myachenkov

๐Ÿ’ป
Stefan Birkner

๐Ÿ›
Stefan Bohn

๐Ÿ›
Stefan Endrullis

๐Ÿ›
Stefan Klรถss-Schuster

๐Ÿ›
Stefan Wolf

๐Ÿ› -
Stephan H. Wissel

๐Ÿ› -
Stephen

๐Ÿ› +
Stephan H. Wissel

๐Ÿ› +
Stephen

๐Ÿ›
Stephen Friedrich

๐Ÿ›
Steve Babula

๐Ÿ’ป
Stexxe

๐Ÿ›
Stian Lรฅgstad

๐Ÿ›
StuartClayton5

๐Ÿ› -
Supun Arunoda

๐Ÿ› -
Suren Abrahamyan

๐Ÿ› +
Supun Arunoda

๐Ÿ› +
Suren Abrahamyan

๐Ÿ›
SwatiBGupta1110

๐Ÿ›
SyedThoufich

๐Ÿ›
Szymon Sasin

๐Ÿ›
T-chuangxin

๐Ÿ›
TERAI Atsuhiro

๐Ÿ› -
TIOBE Software

๐Ÿ’ป ๐Ÿ› -
Taylor Smock

๐Ÿ› +
TIOBE Software

๐Ÿ’ป ๐Ÿ› +
Taylor Smock

๐Ÿ›
Techeira Damiรกn

๐Ÿ’ป ๐Ÿ›
Ted Husted

๐Ÿ›
TehBakker

๐Ÿ›
The Gitter Badger

๐Ÿ›
Theodoor

๐Ÿ› -
Thiago Henrique Hรผpner

๐Ÿ› -
Thibault Meyer

๐Ÿ› +
Thiago Henrique Hรผpner

๐Ÿ› +
Thibault Meyer

๐Ÿ›
Thomas Gรผttler

๐Ÿ›
Thomas Jones-Low

๐Ÿ›
Thomas Smith

๐Ÿ’ป ๐Ÿ›
ThrawnCA

๐Ÿ›
Thunderforge

๐Ÿ’ป ๐Ÿ› -
Tim van der Lippe

๐Ÿ› -
Tobias Weimer

๐Ÿ’ป ๐Ÿ› +
Tim van der Lippe

๐Ÿ› +
Tobias Weimer

๐Ÿ’ป ๐Ÿ›
Tom Daly

๐Ÿ›
Tomer Figenblat

๐Ÿ›
Tomi De Lucca

๐Ÿ’ป ๐Ÿ›
Torsten Kleiber

๐Ÿ›
TrackerSB

๐Ÿ› -
Ullrich Hafner

๐Ÿ› -
Utku Cuhadaroglu

๐Ÿ’ป ๐Ÿ› +
Ullrich Hafner

๐Ÿ› +
Utku Cuhadaroglu

๐Ÿ’ป ๐Ÿ›
Valentin Brandl

๐Ÿ›
Valeria

๐Ÿ›
Vasily Anisimov

๐Ÿ›
Vibhor Goyal

๐Ÿ›
Vickenty Fesunov

๐Ÿ› -
Victor Noรซl

๐Ÿ› -
Vincent Galloy

๐Ÿ’ป +
Victor Noรซl

๐Ÿ› +
Vincent Galloy

๐Ÿ’ป
Vincent HUYNH

๐Ÿ›
Vincent Maurin

๐Ÿ›
Vincent Privat

๐Ÿ›
Vishhwas

๐Ÿ›
Vitaly

๐Ÿ› -
Vitaly Polonetsky

๐Ÿ› -
Vojtech Polivka

๐Ÿ› +
Vitaly Polonetsky

๐Ÿ› +
Vojtech Polivka

๐Ÿ›
Vsevolod Zholobov

๐Ÿ›
Vyom Yadav

๐Ÿ’ป
Wang Shidong

๐Ÿ›
Waqas Ahmed

๐Ÿ›
Wayne J. Earl

๐Ÿ› -
Wchenghui

๐Ÿ› -
Will Winder

๐Ÿ› +
Wchenghui

๐Ÿ› +
Will Winder

๐Ÿ›
William Brockhus

๐Ÿ’ป ๐Ÿ›
Wilson Kurniawan

๐Ÿ›
Wim Deblauwe

๐Ÿ›
Woongsik Choi

๐Ÿ›
XenoAmess

๐Ÿ’ป ๐Ÿ› -
Yang

๐Ÿ’ป -
YaroslavTER

๐Ÿ› +
Yang

๐Ÿ’ป +
YaroslavTER

๐Ÿ›
Young Chan

๐Ÿ’ป ๐Ÿ›
YuJin Kim

๐Ÿ›
Yuri Dolzhenko

๐Ÿ›
Yurii Dubinka

๐Ÿ›
Zoltan Farkas

๐Ÿ› -
Zustin

๐Ÿ› -
aaronhurst-google

๐Ÿ› +
Zustin

๐Ÿ› +
aaronhurst-google

๐Ÿ›
alexmodis

๐Ÿ›
andreoss

๐Ÿ›
andrey81inmd

๐Ÿ’ป ๐Ÿ›
anicoara

๐Ÿ›
arunprasathav

๐Ÿ› -
asiercamara

๐Ÿ› -
astillich-igniti

๐Ÿ’ป +
asiercamara

๐Ÿ› +
astillich-igniti

๐Ÿ’ป
avesolovksyy

๐Ÿ›
avishvat

๐Ÿ›
avivmu

๐Ÿ›
axelbarfod1

๐Ÿ›
b-3-n

๐Ÿ› -
balbhadra9

๐Ÿ› -
base23de

๐Ÿ› +
balbhadra9

๐Ÿ› +
base23de

๐Ÿ›
bergander

๐Ÿ›
berkam

๐Ÿ’ป ๐Ÿ›
breizh31

๐Ÿ›
caesarkim

๐Ÿ›
carolyujing

๐Ÿ› -
cesares-basilico

๐Ÿ› -
chrite

๐Ÿ› +
cesares-basilico

๐Ÿ› +
chrite

๐Ÿ›
cobratbq

๐Ÿ›
coladict

๐Ÿ›
cosmoJFH

๐Ÿ›
cristalp

๐Ÿ›
crunsk

๐Ÿ› -
cwholmes

๐Ÿ› -
cyberjj999

๐Ÿ› +
cwholmes

๐Ÿ› +
cyberjj999

๐Ÿ›
cyw3

๐Ÿ›
d1ss0nanz

๐Ÿ›
dalizi007

๐Ÿ’ป
danbrycefairsailcom

๐Ÿ›
dariansanity

๐Ÿ› -
darrenmiliband

๐Ÿ› -
davidburstrom

๐Ÿ› +
darrenmiliband

๐Ÿ› +
davidburstrom

๐Ÿ›
dbirkman-paloalto

๐Ÿ›
deepak-patra

๐Ÿ›
dependabot[bot]

๐Ÿ’ป ๐Ÿ›
dinesh150

๐Ÿ›
diziaq

๐Ÿ› -
dreaminpast123

๐Ÿ› -
duanyanan

๐Ÿ› +
dreaminpast123

๐Ÿ› +
duanyanan

๐Ÿ›
dutt-sanjay

๐Ÿ›
dylanleung

๐Ÿ›
dzeigler

๐Ÿ›
ekkirala

๐Ÿ›
emersonmoura

๐Ÿ› -
fairy

๐Ÿ› -
filiprafalowicz

๐Ÿ’ป +
fairy

๐Ÿ› +
filiprafalowicz

๐Ÿ’ป
foxmason

๐Ÿ›
frankegabor

๐Ÿ›
frankl

๐Ÿ›
freafrea

๐Ÿ›
fsapatin

๐Ÿ› -
gracia19

๐Ÿ› -
guo fei

๐Ÿ› +
gracia19

๐Ÿ› +
guo fei

๐Ÿ›
gurmsc5

๐Ÿ›
gwilymatgearset

๐Ÿ’ป ๐Ÿ›
haigsn

๐Ÿ›
hemanshu070

๐Ÿ›
henrik242

๐Ÿ› -
hongpuwu

๐Ÿ› -
hvbtup

๐Ÿ’ป ๐Ÿ› +
hongpuwu

๐Ÿ› +
hvbtup

๐Ÿ’ป ๐Ÿ›
igniti GmbH

๐Ÿ›
ilovezfs

๐Ÿ›
itaigilo

๐Ÿ›
jakivey32

๐Ÿ›
jbennett2091

๐Ÿ› -
jcamerin

๐Ÿ› -
jkeener1

๐Ÿ› +
jcamerin

๐Ÿ› +
jkeener1

๐Ÿ›
jmetertea

๐Ÿ›
johnra2

๐Ÿ’ป
josemanuelrolon

๐Ÿ’ป ๐Ÿ›
kabroxiko

๐Ÿ’ป ๐Ÿ›
karwer

๐Ÿ› -
kaulonline

๐Ÿ› -
kdaemonv

๐Ÿ› +
kaulonline

๐Ÿ› +
kdaemonv

๐Ÿ›
kenji21

๐Ÿ’ป ๐Ÿ›
kfranic

๐Ÿ›
khalidkh

๐Ÿ›
krzyk

๐Ÿ›
lasselindqvist

๐Ÿ› -
lgemeinhardt

๐Ÿ› -
lihuaib

๐Ÿ› +
lgemeinhardt

๐Ÿ› +
lihuaib

๐Ÿ›
lonelyma1021

๐Ÿ›
lpeddy

๐Ÿ›
lujiefsi

๐Ÿ’ป
lukelukes

๐Ÿ’ป
lyriccoder

๐Ÿ› -
marcelmore

๐Ÿ› -
matchbox

๐Ÿ› +
marcelmore

๐Ÿ› +
matchbox

๐Ÿ›
matthiaskraaz

๐Ÿ›
meandonlyme

๐Ÿ›
mikesive

๐Ÿ›
milossesic

๐Ÿ›
mriddell95

๐Ÿ› -
mrlzh

๐Ÿ› -
msloan

๐Ÿ› +
mrlzh

๐Ÿ› +
msloan

๐Ÿ›
mucharlaravalika

๐Ÿ›
mvenneman

๐Ÿ›
nareshl119

๐Ÿ›
nicolas-harraudeau-sonarsource

๐Ÿ›
noerremark

๐Ÿ› -
novsirion

๐Ÿ› -
oggboy

๐Ÿ› +
novsirion

๐Ÿ› +
oggboy

๐Ÿ›
oinume

๐Ÿ›
orimarko

๐Ÿ’ป ๐Ÿ›
pallavi agarwal

๐Ÿ›
parksungrin

๐Ÿ›
patpatpat123

๐Ÿ› -
patriksevallius

๐Ÿ› -
pbrajesh1

๐Ÿ› +
patriksevallius

๐Ÿ› +
pbrajesh1

๐Ÿ›
phoenix384

๐Ÿ›
piotrszymanski-sc

๐Ÿ’ป
plan3d

๐Ÿ›
poojasix

๐Ÿ›
prabhushrikant

๐Ÿ› -
pujitha8783

๐Ÿ› -
r-r-a-j

๐Ÿ› +
pujitha8783

๐Ÿ› +
r-r-a-j

๐Ÿ›
raghujayjunk

๐Ÿ›
rajeshveera

๐Ÿ›
rajeswarreddy88

๐Ÿ›
recdevs

๐Ÿ›
reudismam

๐Ÿ’ป ๐Ÿ› -
rijkt

๐Ÿ› -
rillig-tk

๐Ÿ› +
rijkt

๐Ÿ› +
rillig-tk

๐Ÿ›
rmohan20

๐Ÿ’ป ๐Ÿ›
rxmicro

๐Ÿ›
ryan-gustafson

๐Ÿ’ป ๐Ÿ›
sabi0

๐Ÿ›
scais

๐Ÿ› -
sebbASF

๐Ÿ› -
sergeygorbaty

๐Ÿ’ป +
sebbASF

๐Ÿ› +
sergeygorbaty

๐Ÿ’ป
shilko2013

๐Ÿ›
shiomiyan

๐Ÿ“–
simeonKondr

๐Ÿ›
snajberk

๐Ÿ›
sniperrifle2004

๐Ÿ› -
snuyanzin

๐Ÿ› ๐Ÿ’ป -
sratz

๐Ÿ› +
snuyanzin

๐Ÿ› ๐Ÿ’ป +
sratz

๐Ÿ›
stonio

๐Ÿ›
sturton

๐Ÿ’ป ๐Ÿ›
sudharmohan

๐Ÿ›
suruchidawar

๐Ÿ›
svenfinitiv

๐Ÿ› -
tashiscool

๐Ÿ› -
test-git-hook

๐Ÿ› +
tashiscool

๐Ÿ› +
test-git-hook

๐Ÿ›
testation21

๐Ÿ’ป ๐Ÿ›
thanosa

๐Ÿ›
tiandiyixian

๐Ÿ›
tobwoerk

๐Ÿ›
tprouvot

๐Ÿ› -
trentchilders

๐Ÿ› -
triandicAnt

๐Ÿ› +
trentchilders

๐Ÿ› +
triandicAnt

๐Ÿ›
trishul14

๐Ÿ›
tsui

๐Ÿ›
winhkey

๐Ÿ›
witherspore

๐Ÿ›
wjljack

๐Ÿ› -
wuchiuwong

๐Ÿ› -
xingsong

๐Ÿ› +
wuchiuwong

๐Ÿ› +
xingsong

๐Ÿ›
xioayuge

๐Ÿ›
xnYi9wRezm

๐Ÿ’ป ๐Ÿ›
xuanuy

๐Ÿ›
xyf0921

๐Ÿ›
yalechen-cyw3

๐Ÿ› -
yasuharu-sato

๐Ÿ› -
zenglian

๐Ÿ› +
yasuharu-sato

๐Ÿ› +
zenglian

๐Ÿ›
zgrzyt93

๐Ÿ’ป ๐Ÿ›
zh3ng

๐Ÿ›
zt_soft

๐Ÿ›
ztt79

๐Ÿ›
zzzzfeng

๐Ÿ› + +
รrpรกd Magosรกnyi

๐Ÿ›
ไปป่ดตๆฐ

๐Ÿ› +
่Œ…ๅปถๅฎ‰

๐Ÿ’ป diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 8abb75f161..80884b18b6 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -19,11 +19,33 @@ This is a {{ site.pmd.release_type }} release. ### New and noteworthy +#### Gherkin support +Thanks to the contribution from [Anne Brouwers](https://github.com/ASBrouwers) PMD now has CPD support +for the [Gherkin](https://cucumber.io/docs/gherkin/) language. It is used to defined test cases for the +[Cucumber](https://cucumber.io/) testing tool for behavior-driven development. + +Being based on a proper Antlr grammar, CPD can: + +* ignore comments +* honor [comment-based suppressions](pmd_userdocs_cpd.html#suppression) + ### Fixed Issues +* java-bestpractices + * [#3455](https://github.com/pmd/pmd/issues/3455): \[java] WhileLoopWithLiteralBoolean - false negative with complex expressions +* java-design + * [#3729](https://github.com/pmd/pmd/issues/3729): \[java] TooManyMethods ignores "real" methods which are named like getters or setters + * [#3949](https://github.com/pmd/pmd/issues/3949): \[java] FinalFieldCouldBeStatic - false negative with unnecessary parenthesis +* java-performance + * [#3625](https://github.com/pmd/pmd/issues/3625): \[java] AddEmptyString - false negative with empty var ### API Changes ### External Contributions +* [#3984](https://github.com/pmd/pmd/pull/3984): \[java] Fix AddEmptyString false-negative issue - [@LiGaOg](https://github.com/LiGaOg) +* [#3988](https://github.com/pmd/pmd/pull/3988): \[java] Modify WhileLoopWithLiteralBoolean to meet the missing case #3455 - [@VoidxHoshi](https://github.com/VoidxHoshi) +* [#3992](https://github.com/pmd/pmd/pull/3992): \[java] FinalFieldCouldBeStatic - fix false negative with unnecessary parenthesis - [@dalizi007](https://github.com/dalizi007) +* [#3994](https://github.com/pmd/pmd/pull/3994): \[java] TooManyMethods - improve getter/setter detection (#3729) - [@341816041](https://github.com/341816041) +* [#4017](https://github.com/pmd/pmd/pull/4017): Add Gherkin support to CPD - [@ASBrouwers](https://github.com/ASBrouwers) {% endtocmaker %} diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java new file mode 100644 index 0000000000..6a2cc25a05 --- /dev/null +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java @@ -0,0 +1,121 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang; + +import net.sourceforge.pmd.annotation.Experimental; +import net.sourceforge.pmd.lang.ast.AstInfo; +import net.sourceforge.pmd.lang.ast.Parser; +import net.sourceforge.pmd.lang.ast.RootNode; +import net.sourceforge.pmd.lang.ast.SourceCodePositioner; +import net.sourceforge.pmd.lang.ast.impl.AbstractNode; + +/** + * A dummy language implementation whose parser produces a single node. + * This is provided for cases where a non-null language is required, but + * the parser is not useful. This is useful eg to mock rules when no other + * language is on the classpath. This language is not exposed by {@link LanguageRegistry} + * and can only be used explicitly with {@link #getInstance()}. + * + * @author Clรฉment Fournier + * @since 6.48.0 + */ +@Experimental +public final class PlainTextLanguage extends BaseLanguageModule { + + private static final Language INSTANCE = new PlainTextLanguage(); + + static final String TERSE_NAME = "text"; + + private PlainTextLanguage() { + super("Plain text", "Plain text", TERSE_NAME, "plain-text-file-goo-extension"); + addVersion("default", new TextLvh(), true); + } + + /** + * Returns the singleton instance of this language. + */ + public static Language getInstance() { + return INSTANCE; + } + + private static final class TextLvh implements LanguageVersionHandler { + @Override + public Parser getParser() { + return parserTask -> new PlainTextFile(parserTask); + } + } + + /** + * The only node produced by the parser of {@link PlainTextLanguage}. + */ + public static final class PlainTextFile extends AbstractNode implements RootNode { + private final int beginLine; + private final int beginColumn; + private final int endLine; + private final int endColumn; + + private final AstInfo astInfo; + + PlainTextFile(Parser.ParserTask parserTask) { + SourceCodePositioner positioner = new SourceCodePositioner(parserTask.getSourceText()); + this.beginLine = 1; + this.beginColumn = 1; + this.endLine = positioner.getLastLine(); + this.endColumn = positioner.getLastLineColumn(); + this.astInfo = new AstInfo<>(parserTask, this); + } + + @Override + public String getXPathNodeName() { + return "TextFile"; + } + + @Override + public String getImage() { + return null; + } + + @Override + public int getBeginLine() { + return beginLine; + } + + @Override + public int getBeginColumn() { + return beginColumn; + } + + @Override + public int getEndLine() { + return endLine; + } + + @Override + public int getEndColumn() { + return endColumn; + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + @Override + public void removeChildAtIndex(int childIndex) { + throw new IndexOutOfBoundsException(); + } + + @Override + public String toString() { + return "Plain text file (" + endLine + "lines)"; + } + + @Override + public AstInfo getAstInfo() { + return astInfo; + } + } + +} diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 39efc28454..2f2062dd91 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -154,6 +154,11 @@ pmd-fortran ${project.version} + + net.sourceforge.pmd + pmd-gherkin + ${project.version} + net.sourceforge.pmd pmd-go diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java index 02650b99c7..a011878546 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java @@ -26,7 +26,7 @@ public class BinaryDistributionIT extends AbstractBinaryDistributionTest { private static final String SUPPORTED_LANGUAGES_PMD; static { - SUPPORTED_LANGUAGES_CPD = "Supported languages: [apex, cpp, cs, dart, ecmascript, fortran, go, groovy, html, java, jsp, kotlin, lua, matlab, modelica, objectivec, perl, php, plsql, python, ruby, scala, swift, vf, xml]"; + SUPPORTED_LANGUAGES_CPD = "Supported languages: [apex, cpp, cs, dart, ecmascript, fortran, gherkin, go, groovy, html, java, jsp, kotlin, lua, matlab, modelica, objectivec, perl, php, plsql, python, ruby, scala, swift, vf, xml]"; SUPPORTED_LANGUAGES_PMD = "apex, ecmascript, html, java, jsp, kotlin, modelica, plsql, pom, scala, swift, vf, vm, wsdl, xml, xsl"; } diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml new file mode 100644 index 0000000000..0d9cb40112 --- /dev/null +++ b/pmd-gherkin/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + pmd-gherkin + PMD Gherkin + + + net.sourceforge.pmd + pmd + 7.0.0-SNAPSHOT + ../pom.xml + + + + + + org.antlr + antlr4-maven-plugin + + + + maven-resources-plugin + + false + + ${*} + + + + + + + + + net.sourceforge.pmd + pmd-core + + + org.antlr + antlr4-runtime + + + + junit + junit + test + + + net.sourceforge.pmd + pmd-test + test + + + net.sourceforge.pmd + pmd-lang-test + test + + + diff --git a/pmd-gherkin/src/main/antlr4/net/sourceforge/pmd/lang/gherkin/ast/Gherkin.g4 b/pmd-gherkin/src/main/antlr4/net/sourceforge/pmd/lang/gherkin/ast/Gherkin.g4 new file mode 100644 index 0000000000..c5e1db52c0 --- /dev/null +++ b/pmd-gherkin/src/main/antlr4/net/sourceforge/pmd/lang/gherkin/ast/Gherkin.g4 @@ -0,0 +1,118 @@ +grammar Gherkin; + +// PARSER + +main + // start comment needed because each comment should start on a new line except for the start comment + : STARTCOMMENT? feature description* instructionLine* NL* EOF + ; + +feature + : (NL* tagline)* NL* FEATURE? + ; + +instructionLine + : NL+ (instruction | datatable) + ; + +instruction + : rulex description* // the name "rule" is not allowed by ANTLR (used for internal usage), so calling it rulex + | stepInstruction description* (NL+ stepDescription description*)* (NL+ step)* + | tagline + | instructionDescription description* + ; + +stepInstruction + : background + | scenario + | scenarioOutline + ; + +background: BACKGROUND ; +rulex: RULEX ; +scenario: SCENARIO ; +scenarioOutline : SCENARIOOUTLINE ; + +step : stepItem description*; + +stepItem + : and + | anystep + | but + | datatable + | given + | then + | when + | (NL* tagline )* NL* examples + ; + +tagline + : TAG+ + ; + +and: AND ; +anystep: ANYSTEP ; +but: BUT ; +datatable: DATATABLE+ ; +given: GIVEN ; +then: THEN ; +when: WHEN ; +examples: EXAMPLES ; + +// Descriptions +instructionDescription: text | PARAMETER | AND | ANYSTEP | BUT | GIVEN | THEN | WHEN | SCENARIO ; // We have to deal with overlaps with keywords +stepDescription: text | PARAMETER ; // We have to deal with overlaps with keywords +description: text | PARAMETER | TAG | AND | ANYSTEP | BUT | DATATABLE | GIVEN | THEN | WHEN | SCENARIO | SCENARIOOUTLINE | STARTCOMMENT ; // We have to deal with overlaps with keywords + +text: TOKEN+ ; + +// LEXER + +// skipped + +BOMUTF8 : '\u00EF\u00BB\u00BF' -> skip ; + +BOMUTF16 : '\uFEFF' -> skip ; + +WHITESPACE: [ \t]+ -> channel(1) ; + +COMMENT: '\r'?'\n' [ \t]* '#' ~[\r\n]* -> channel(2) ; + +STARTCOMMENT: '#' ~[\r\n]* ; + +DOCSTRING1 + : '"""' .*? '"""' ; + +DOCSTRING2 + : '```' .*? '```' ; + +// Instructions +BACKGROUND: 'Background:' ; +EXAMPLES: ('Examples:' | 'Scenarios:') ; +FEATURE: 'Feature:'; +RULEX: 'Rule:' ; +SCENARIO: ('Example:' | 'Scenario:') ; +SCENARIOOUTLINE : 'Scenario ' ('Outline:' | 'Template:') ; + +// Steps +AND: 'And' ; +ANYSTEP: '*' ; +BUT: 'But' ; +DATATABLE: '|' DATATABLEID? ; // must be an ID because it can contain a space +GIVEN: 'Given' ; +THEN: 'Then' ; +WHEN: 'When' ; + +TAG: '@' ELEMENT+ ; +PARAMETER: '<' PARID '>' | '"' '<' PARID '>' '"' | '\'' '<' PARID '>' '\''; +fragment PARID: [A-Za-z0-9] ([!-=?-~ ]* [!-=?-~])?; // start with an alpha numerical and then all printable characters and end with a non-space +fragment ID: (IDELEMENT | ' ')* IDELEMENT (IDELEMENT | ' ')*; // ID should contain at least one non-whitespace character otherwise the trailing | with a trailing space will match +fragment DATATABLEID: (DATATABLEELEMENT | ' ')* DATATABLEELEMENT (DATATABLEELEMENT | ' ')*; // ID should contain at least one non-whitespace character otherwise the trailing | with a trailing space will match +fragment DATATABLEELEMENT: ELEMENT | '<' | '>' | '"' | '\'' | '\\|' ; +fragment IDELEMENT: ELEMENT | '|' ; +fragment ELEMENT: [!-&(-;=?-{}~\u00A0-\uFFFF] ; + +NL: '\r'? '\n' ; +TOKEN: [!-{}-~\u00A0-\uFFFF]+ ; // match everything that isn't matched yet + + diff --git a/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/ast/package-info.java b/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/ast/package-info.java new file mode 100644 index 0000000000..109abde01a --- /dev/null +++ b/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/ast/package-info.java @@ -0,0 +1,8 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * Contains the Antlr grammar for Gherkin. + */ +package net.sourceforge.pmd.lang.gherkin.ast; diff --git a/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinLanguage.java b/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinLanguage.java new file mode 100644 index 0000000000..d95282944b --- /dev/null +++ b/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinLanguage.java @@ -0,0 +1,20 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.gherkin.cpd; + +import net.sourceforge.pmd.cpd.AbstractLanguage; + +/** + * Language implementation for Gherkin. + */ +public class GherkinLanguage extends AbstractLanguage { + + /** + * Creates a new Gherkin Language instance. + */ + public GherkinLanguage() { + super("Gherkin", "gherkin", new GherkinTokenizer(), ".feature"); + } +} diff --git a/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinTokenizer.java b/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinTokenizer.java new file mode 100644 index 0000000000..485be4bf2d --- /dev/null +++ b/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinTokenizer.java @@ -0,0 +1,24 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.gherkin.cpd; + +import org.antlr.v4.runtime.CharStream; + +import net.sourceforge.pmd.cpd.SourceCode; +import net.sourceforge.pmd.cpd.internal.AntlrTokenizer; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTokenManager; +import net.sourceforge.pmd.lang.gherkin.ast.GherkinLexer; + +/** + * The Gherkin Tokenizer. + */ +public class GherkinTokenizer extends AntlrTokenizer { + + @Override + protected AntlrTokenManager getLexerForSource(SourceCode sourceCode) { + CharStream charStream = AntlrTokenizer.getCharStreamFromSourceCode(sourceCode); + return new AntlrTokenManager(new GherkinLexer(charStream), sourceCode.getFileName()); + } +} diff --git a/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/cpd/package-info.java b/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/cpd/package-info.java new file mode 100644 index 0000000000..9a25b68105 --- /dev/null +++ b/pmd-gherkin/src/main/java/net/sourceforge/pmd/lang/gherkin/cpd/package-info.java @@ -0,0 +1,8 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * Contains Gherkin tokenizer and language classes. + */ +package net.sourceforge.pmd.lang.gherkin.cpd; diff --git a/pmd-gherkin/src/main/resources/META-INF/services/net.sourceforge.pmd.cpd.Language b/pmd-gherkin/src/main/resources/META-INF/services/net.sourceforge.pmd.cpd.Language new file mode 100644 index 0000000000..fbe21e1710 --- /dev/null +++ b/pmd-gherkin/src/main/resources/META-INF/services/net.sourceforge.pmd.cpd.Language @@ -0,0 +1 @@ +net.sourceforge.pmd.lang.gherkin.cpd.GherkinLanguage diff --git a/pmd-gherkin/src/test/java/net/sourceforge/pmd/cpd/GherkinTokenizerTest.java b/pmd-gherkin/src/test/java/net/sourceforge/pmd/cpd/GherkinTokenizerTest.java new file mode 100644 index 0000000000..f8f064ea41 --- /dev/null +++ b/pmd-gherkin/src/test/java/net/sourceforge/pmd/cpd/GherkinTokenizerTest.java @@ -0,0 +1,39 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.cpd; + +import java.util.Properties; + +import org.junit.Test; + +import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; +import net.sourceforge.pmd.lang.gherkin.cpd.GherkinTokenizer; + +public class GherkinTokenizerTest extends CpdTextComparisonTest { + public GherkinTokenizerTest() { + super(".feature"); + } + + @Override + protected String getResourcePrefix() { + return "../lang/gherkin/cpd/testdata"; + } + + @Override + public Tokenizer newTokenizer(Properties properties) { + GherkinTokenizer tok = new GherkinTokenizer(); + return tok; + } + + @Test + public void testAnnotatedSource() { + doTest("annotatedSource"); + } + + @Test + public void testDocstring() { + doTest("docstring"); + } +} diff --git a/pmd-gherkin/src/test/resources/net/sourceforge/pmd/lang/gherkin/cpd/testdata/annotatedSource.feature b/pmd-gherkin/src/test/resources/net/sourceforge/pmd/lang/gherkin/cpd/testdata/annotatedSource.feature new file mode 100644 index 0000000000..45008f6c71 --- /dev/null +++ b/pmd-gherkin/src/test/resources/net/sourceforge/pmd/lang/gherkin/cpd/testdata/annotatedSource.feature @@ -0,0 +1,73 @@ +@AnnotatedSource +Feature: Annotated Source + The annotated source displays violations in the source file. It opens in a new window. + + Rules: + 1 Annotation metrics can be selected with a dropdown menu. Only enabled metrics must be shown. + 2 When the annotated source is opened while a specific metric is selected, only that metric should be selected. + 3 A user can scroll through the violations using two buttons (illustrated by up and down arrows). The arrows wrap around the document. + 4 The table collumn "Type" is only shown when multiple metrics are selected + + Scenario: Select a metric type + Given the Annotated Source for file "HIE://11261-37/main/monop/execute.c" + When a user opens the dropdown menu containing "Metric:" + And the user clicks on the dropdown option "Violations/Coding Standard Violations" + Then the selected annotation in the source code should be on line 38 + And the selected annotation in the table should be on line 38 + + Scenario: The user can use the arrows, or "a" and "z" keys, to scroll through the annotations + Given the Annotated Source for file "HIE://11261-37/main/monop/execute.c" + And metric "Coding Standard Violation Annotations" is selected + When the user clicks on the down arrow + And the user presses the "Z" key + And the user clicks on the up arrow + And the user clicks on the up arrow + And the user presses the "A" key + Then the selected annotation in the source code should be on line 254 + + @Rule2 + Scenario Outline: If the user opens the annotated source from e.g. the dashboard for a metric, + only the related annotations should be shown. + Given the Dashboard + And filtering by Project "17607" + And grouping by "File" + And metric "" is selected + When a user opens the file "clalgorithm_settings.c" using the metric table + Then a new browser window with an "Annotated Source" should be opened + Then only the annotations "" should be selected + + Examples: + | metric | annotations | + | TQI Coding Standards | Coding Standard Violation Annotations | + | Coding Standard Violations | Coding Standard Violation Annotations | + | TQI Compiler Warnings | Compiler Warning Annotations | + | Fan Out (%) | Fan Out Annotations | + | TQI Dead Code | Dead Code Annotations | + | TQI Code Duplication | Code Duplication Annotations | + + Scenario: The user should be able to filter Coding Standard Violations by Level + Given the Annotated Source for file "HIE://11514/trunk/components/java/BuildUtil/src/com/tiobe/util/BuildProperties.java" + And the metric "Coding Standard Violations" is selected + When the user opens the dropdown menu "Level" + And the user clicks on the dropdown option "5" + Then there should be 1 violation + And the selected annotation in the source code should be on line 57 + And the annotation should be of level 5 + + @PR27030 + Scenario Outline: The user should be able to filter Coding Standard Violations by Level, Category, Rule, etc + Given the Annotated Source for file "HIE://12939/main/Implementatie/DRGL/src/DirectDoorvoerenAdmin.cpp" + And metric "" is selected + When the user opens the dropdown menu containing "" inside the filter bar + And the user clicks on the dropdown option "