CodeGuidelines icon indicating copy to clipboard operation
CodeGuidelines copied to clipboard

Guidelines for Adblock Filter Lists

Open scripthunter7 opened this issue 3 years ago • 4 comments

I think it is worth considering compiling a guideline for Adblock Filter Lists.

In my opinion, there are two main groups of policies:

  • Syntactic / formatting specifications
  • Application specifications: routines, best practices <-> bad practices

I think such guidelines could be:

  • Preferred scriptlet quote marks,
  • Formatting of CSS selectors, e.g. whether there should be a space before !important
  • Application of general <-> specific principles (e.g. EasyList is a very general list, and AG filters are more specific),
  • Contraindication of multiple selectors within a rule: example.com##.ad1, .ad2
  • Taking into account the limitations of content blockers, e.g. creating regular exception network rules next to scriptlets
  • Comment guides, e.g. put one space after comment marker, link issues before rules
  • Rule ordering/grouping, where to place a new rule
  • Where to place a new domain if the rule is already exists
  • etc.

The description of the filter repo doesn't cover such things: https://github.com/AdguardTeam/AdguardFilters/blob/master/CONTRIBUTING.md

I would be happy if you could share your opinion. 🙂

@ameshkov @Alex-302 @zloyden @AdamWr

scripthunter7 avatar Jan 30 '23 11:01 scripthunter7

@AdguardTeam/filters-maintainers what do you all think about that?

ameshkov avatar Jan 30 '23 20:01 ameshkov

Of course we need it. There was even a discussed a half year ago, but it didn't get to the point:(

Alex-302 avatar Jan 30 '23 21:01 Alex-302

Do you think that this guideline must be applied retroactively?

piquark6046 avatar Jan 31 '23 00:01 piquark6046

In my experience the route we should take is the following:

  1. First, formulate the guidelines that everyone is happy with.
  2. Follow those guidelines when adding new rules, at the same time the guidelines will likely be slightly adjusted.
  3. When all are comfortable with the guidelines, start slowly refactoring the old rules.

ameshkov avatar Jan 31 '23 07:01 ameshkov