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

Validate regexp values of $domain modifier #202

Open
zloyden opened this issue Feb 5, 2024 · 4 comments
Open

Validate regexp values of $domain modifier #202

zloyden opened this issue Feb 5, 2024 · 4 comments
Assignees
Labels
bug Something isn't working Priority: P4

Comments

@zloyden
Copy link
Contributor

zloyden commented Feb 5, 2024

The linter won't let the rule below through because of a supposedly incorrect value in the domain, but that's not true.

/xyzsports\d+\.xyz\/assets\/images\/\w{3}\//$image,domain=/xyzsports\d+\.xyz/
Screenshot:

image


@scripthunter7
Copy link
Member

Currently regexp items are not validated for $domain modifier: https://github.com/AdguardTeam/tsurlfilter/blob/e27098b4d328a910a2bf3e2b1649a8675fd89e1f/packages/agtree/src/validator/value.ts#L177-L187

Please temporarily disable the invalid-modifiers rule for this type of filtering rule by adding a ! aglint-disable-next-line invalid-modifiers line before them.

cc @Alex-302

@Alex-302
Copy link
Member

Alex-302 commented Feb 5, 2024

It was added with the necessary rule and comment
AdguardTeam/AdguardFilters@c859bcd#diff-9447c6eb8cb0810a43523b3b8ac678e57f51cabe845101b5c45ab28dc29090e7R3971-R3974

@scripthunter7
Copy link
Member

No need to disable the linter completely for that filtering rule, specifying problematic linter rule name is enough

@zloyden zloyden changed the title Incorrect validation of the $domain modifier value Validate regexp values of $domain modifier Feb 5, 2024
zloyden added a commit to AdguardTeam/AdguardFilters that referenced this issue Feb 5, 2024
@zloyden
Copy link
Contributor Author

zloyden commented Feb 5, 2024

I've updated it, thank you)

@scripthunter7 scripthunter7 added the bug Something isn't working label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: P4
Projects
None yet
Development

No branches or pull requests

5 participants