Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Allow XPath rules to access the current file name #3446

Closed
oowekyala opened this issue Aug 7, 2021 Discussed in #3444 · 2 comments · Fixed by #3447
Closed

[core] Allow XPath rules to access the current file name #3446

oowekyala opened this issue Aug 7, 2021 Discussed in #3444 · 2 comments · Fixed by #3447
Assignees
Labels
an:enhancement An improvement on existing features / rules in:xpath Relating to xpath support at large, eg Jaxen / Saxon, custom functions, attribute resolution
Milestone

Comments

@oowekyala
Copy link
Member

Discussed in #3444

Originally posted by rsoesemann August 6, 2021
I want to use XPath rules to check whether files name comply with certain naming rules? Is that possible in PMD?

-> not currently supported, we can add an attribute to apex root nodes in PMD 6. In PMD 7 we can add an attribute to all RootNodes

@oowekyala oowekyala added the an:enhancement An improvement on existing features / rules label Aug 7, 2021
@oowekyala oowekyala self-assigned this Aug 7, 2021
@rsoesemann
Copy link
Member

@oowekyala would it be hard to make that work for arbitrary languages or at least XML? I need it for the hundreds of different XML metadata files that exist in the Salesforce ecosystem.

@oowekyala
Copy link
Member Author

For xml ideally we'd use an xpath function, since we wouldn't want to add attributes that don't exist... I'll look into whether that's possible, if so, maybe we can make that language-independent

@oowekyala oowekyala changed the title [apex] Allow XPath rules to access the current file name [core] Allow XPath rules to access the current file name Aug 8, 2021
@oowekyala oowekyala added the in:xpath Relating to xpath support at large, eg Jaxen / Saxon, custom functions, attribute resolution label Aug 8, 2021
@adangel adangel added this to the 6.38.0 milestone Aug 22, 2021
adangel added a commit to adangel/pmd that referenced this issue Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules in:xpath Relating to xpath support at large, eg Jaxen / Saxon, custom functions, attribute resolution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants