-
Notifications
You must be signed in to change notification settings - Fork 12
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
Compatibility table, converter #90
Comments
I think a compatibility table will be VERY useful, but in order to make it "maintainable", we need filters maintainers expertise here. The idea is that we should have a table in the repo that filters maintainers can contribute to. |
@ameshkov I haven't specified the details yet, but my idea is to store the data in a TS object / JSON file / YML file. TS/YML file would be best as they allow comments. I think these are clear and easy-to-manage formats. Of course, we will add a documentation that describes exactly this structure. |
Makes perfect sense to me |
I thought about compatibility tables, here is a draft of what I have in mind. First of all, there is an important point to keep in mind: we need a maintainable, convenient data structure. Even if it needs to be converted later by a build to be "optimal" for good performance, it should be easy to maintain. What I was thinking about is the following:
What should be detailed in the records?
The fields may change depending on the individual categories, so it is advisable to put them in separate files. Here is a draft of what the adg_for_windows:
- name: script
params: false
deprecated: false
version_added: '1.0'
docs: https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#script-modifier
description: The rule corresponds to script requests, e.g. javascript, vbscript. or {
"adg_for_windows": [
{
"name": "script",
"params": false,
"deprecated": false,
"version_added": "1.0",
"docs": "https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#script-modifier",
"description": "The rule corresponds to script requests, e.g. javascript, vbscript."
}
]
} Points to consider:
|
Sounds good to me. I think we should start with something, if we realize that there are any flaws in the chosen structure, converting it to a different one would not be too complicated compared to filling out the table. |
Yes, a scope of this size probably cannot be covered perfectly at first, but we will see the edge cases in time. |
We should detect incompatible rules during the linting process and offer converted rules as fixes, if possible. In order to do this, we need a compatibility table / converter. Theoretically, this could be implemented directly within linter rules, but a standalone API would be more convenient.
This API should be able to:
Points worth considering:
Please note that this compatibility table is a quite bit different from the one in the Scriptlets library, since it must be able to convert from any syntax to any syntax, and it must also handle selectors, HTML filtering rules, etc.
@ameshkov I opened this issue so that we can schedule this as part of future developments. What do you think?
The text was updated successfully, but these errors were encountered: