DeadDomainsLinter icon indicating copy to clipboard operation
DeadDomainsLinter copied to clipboard

Add comment leftovers removing

Open Alex-302 opened this issue 1 year ago • 0 comments

In general not all comments should be removed because they also used for description of groups or rules purposes.

But simple comments may be removed.

For example selected ! https://github.com/AdguardTeam/repo_name/ comments can be removed quite harmlessly image

Criteria for removal:

  • the rule(s) [+ HINT] to be deleted is accompanied by a comment of the following form ! https://github.com/AdguardTeam/repo_name/
  • the line following the rule(s) to be deleted is a comment of the form ! https://github.com/AdguardTeam/repo_name/

Some rules may be accompanied by a few comments (not multiline comments - we will handle them manually). For example:

! https://github.com/AdguardTeam/CoreLibs/issues/1763
! Website checks Content-MD5 in response headers and if it's empty does not display a content
@@||devfaq.ru/*/search?*&method=HEAD$xmlhttprequest,document
! https://github.com/AdguardTeam/CoreLibs/issues/1744
!+ PLATFORM(windows, mac, android)
@@||bing.com/search?showselans=$document,subdocument,important
! comment line 1
! comment line 2
@@||jetpack.io^$elemhide,jsinject,extension,content
! https://github.com/AdguardTeam/CoreLibs/issues/1830
! TODO: check the bug status 14.12.23
!+ PLATFORM(windows, mac, android)
@@||unicode.org^$content
! https://github.com/AdguardTeam/CoreLibs/issues/123
  • if bing.com is dead, ! https://github.com/AdguardTeam/repo_name/ + HINT can be removed.
  • if unicode.org is dead, ! https://github.com/AdguardTeam/repo_name/ + any text comment + HINT can be removed.
  • if jetpack.io is dead, don't remove comments
!
! This section contains the list of third-party advertising networks domains.
! Note, that we only put rules that block full domains here and not URL parts (there's `general_url.txt` for that). Also, it must be domains that are used in a third-party context.
! The rules with hints are at the end of file.

! Good: ||doubleclick.net^$third-party
! Bad: /banner.jpg (should be in general_url.txt)
! Bad: ||adssubdomain.legitwebsite.com^ (should be in adservers_firstparty.txt)
!
!
!
||venturepeasant.com^
||riweeboo.com^
||8trd.online^
// another rules or the end of file

if venturepeasant.com, riweeboo.com, 8trd.online are dead - do not remove comments.

! SECTION: KillAdBlock
! https://github.com/AdguardTeam/AdguardFilters/issues/82559
zuketcreation.net#@##adMid1
zuketcreation.net#@##ad_feature
zuketcreation.net#@##adtagfooter
zuketcreation.net#@##docmainad
zuketcreation.net#@##myAd
zuketcreation.net#@##travel_ad
! '#$#.pub_300x250.pub_300x250m.pub_728x90.text-ad.textAd.text_ad.text_ads.text-ads.text-ad-links { display: block !important; }'
zuketcreation.net#$#.pub_300x250.pub_300x250m.pub_728x90.text-ad.textAd.text_ad.text_ads.text-ads.text-ad-links { display: block !important; }
!#if (adguard_ext_safari || adguard_app_ios || adguard_ext_android_cb)
! exclusions for platforms without CSS rules support
tapewithadblock.org#@#.pub_300x250
tapewithadblock.org#@#.pub_300x250m
tapewithadblock.org#@#.pub_728x90
tapewithadblock.org#@#.text-ad
tapewithadblock.org#@#.text-ad-links
tapewithadblock.org#@#.text-ads
tapewithadblock.org#@#.textAd
tapewithadblock.org#@#.text_ad
tapewithadblock.org#@#.text_ads
tapewithadblock.org#@#.textad
tapewithadblock.org#@#.TextAd
! https://github.com/AdguardTeam/AdguardFilters/issues/67366
articlix.com,fantastic-film.online,joinfaucet.com#@#.textad
articlix.com,fantastic-film.online,joinfaucet.com#@#.TextAd
!#endif
! NOTE: KillAdBlock end ⬆️
! !SECTION: KillAdBlock

In this case, if domain of the section are dead, comments should not be removed. We will handle them manually, because such groups may be reused many times. That's why the criteria for removal is so limited.

Alex-302 avatar Jan 29 '24 13:01 Alex-302