Can an (XPath) rule check the current file name? #3444
Answered
by
adangel
rsoesemann
asked this question in
Q&A
-
I want to use XPath rules to check whether files name comply with certain naming rules? Is that possible in PMD? |
Beta Was this translation helpful? Give feedback.
Answered by
adangel
Aug 22, 2021
Replies: 2 comments 3 replies
-
Not possible with xpath rules yet. We could add an xpath function to fetch the file name though |
Beta Was this translation helpful? Give feedback.
3 replies
-
With PMD 6.38.0 and later, there is a new XPath function "pmd:fileName()" which returns the current filename - see https://docs.pmd-code.org/snapshot/pmd_userdocs_extending_writing_xpath_rules.html#pmd-fileName for the docs. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
adangel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With PMD 6.38.0 and later, there is a new XPath function "pmd:fileName()" which returns the current filename - see https://docs.pmd-code.org/snapshot/pmd_userdocs_extending_writing_xpath_rules.html#pmd-fileName for the docs.