Skip to content

Latest commit

 

History

History
235 lines (167 loc) · 11 KB

CONTRIBUTING.md

File metadata and controls

235 lines (167 loc) · 11 KB

Contributing to AdGuard filters

If you want to make AdGuard better by creating new rules, follow the instructions below to make your ideas come to life faster!

Pre-requisites

  • You need to have a GitHub account to make contributions.
  • You need to have the following tools installed on your machine:
    • Git
    • Node.js (we recommend using the latest LTS version)
    • Yarn (you can install it using npm: npm install -g yarn)
    • Visual Studio Code (we recommend using this editor)
      • Install the recommended extensions for VSCode (listed in .vscode/extensions.json).
        • At first launch, you will be prompted to install them. If not, press CTRL+SHIFT+P and type Show Recommended Extensions and install them.
        • Please note that, by default Comment Anchors does not know adblock-style comments (like ! this is a comment), so you'll need to add ! as a match prefix in the commentAnchors.tags.matchPrefix setting (File -> Preferences -> Settings -> Extensions -> Comment Anchors Configuration).

Setting up the repository

After you have installed the necessary tools, you need to set up the repository.

  1. Fork the original repository on GitHub. This will create a copy of the repository in your account.
  2. Clone remote repository from GitHub to your local machine.
  3. Install the dependencies by running the following command in the terminal:
    yarn install
    This will install necessary tools like AGLint and initialize Husky hooks.

Workflow for submitting changes

  1. Create a new branch for your changes. Please use the following naming convention: fix/123 where 123 is the issue number you're working on.
  2. Make your changes, test them and put them in the proper file or section of the file.
    • You can learn how to write filtering rules in the How to write filter rules section.
    • Please read and understand the current filters policy we adhere to.
    • One of its most important points is the quality requirements.
    • When you're done with creating rules, please take a look at the similar ones in the filters. This may help you to make a better version of the rule.
    • Please read the Repository structure section below to learn more about the structure of the repo and where to put your rules.
  3. If everything is fine, commit your changes. Please try to separate branches and commits for different issues and don't mix them in one. It is easier to manage and review them that way.
    • Note: By default, Husky pre-commit hook will run AGLint on your changes and will prevent you from committing if there are any errors in your changes.
  4. Push your new branch to your remote repository.
  5. Create a pull request from your branch to the master branch of the original repository. AGLint will run automatically on your PR and will report any errors. If there are any errors, fix them and push your changes to your fork. If AGLint passes, your PR will be reviewed by a maintainer.
  6. If the review is successful, your changes will be merged into the master branch.

Skipping checks

If you need to skip running checks, you can do it in the following ways. Please note that it is only allowed in special cases and should not be used as a regular practice.

  • Skip running Husky pre-commit hook: git commit --no-verify -m "commit message".
  • Skip running checks on GitHub: add [skip ci] to the commit message as a prefix.

Repository structure

AdGuard filters are compiled from files in this repository. This is an automated process that is periodically run by scripts in the FiltersRegistry repo. In this repository, each filter list is divided into several files, and each file has its own purpose. If you're adding a new rule, make sure it is added to the proper file or section of the file.

General requirements for submitting rules: don't add rules to the beginning of the file, start entering them from line 4, for example. If you add rules with a task comment or hints, put them next to the same structure in the file.

AdGuard Base filter

  • Purpose: this filter blocks various kinds of ads mostly on English-language and multilingual sites.
  • Base folder
  • Notes: The AdGuard Base filter includes Easylist, so there's no need to add rules which are already in Easylist.

AdGuard Mobile filter

  • Purpose: this filter blocks various kinds of ads on mobile version of sites and in mobile apps.
  • Mobile folder

AdGuard Tracking Protection filter

AdGuard URL Tracking filter

  • Purpose: this filter removes various kinds of tracking parameters from sites.
  • URL Tracking folder

AdGuard Social filter

  • Purpose: this filter blocks various kinds of social widgets from sites.
  • Social folder

AdGuard Annoyances filters

  • Purpose: this filter blocks irritating elements on web pages including cookie notices, third-party widgets and in-page pop-ups.

  • Annoyances folder

    Contains the following AdGuard filters: Cookie Notices, Popups, Mobile App Banners, Other Annoyances and Widgets:

    • Cookie Notices

      Purpose: this filter blocks cookie notices on web pages.

    • Mobile App Banners

      • Purpose: this filter blocks irritating banners that promote mobile apps of websites.
      • MobileApp folder
    • Popups

      • Purpose: this filter blocks all kinds of pop-ups that are not necessary for websites' operation.
      • Popups folder
    • Widgets

      • Purpose: this filter blocks annoying third-party widgets: online assistants, live support chats, etc.
      • Widgets folder
    • Other Annoyances

      • Purpose: this filter blocks irritating elements on web pages that do not fall under the popular categories of annoyances.
      • Other folder

AdGuard Experimental filter

  • Purpose: this filter serves to test some new filtering rules that can potentially cause conflicts and mess with websites' work. In case these rules perform without any issues, they get added to main filters.
  • Experimental folder

AdGuard Filter unblocking search ads and self-promotions

AdGuard Russian filter

  • Purpose: this filter blocks various kinds of ads on Russian-language sites.
  • Russian folder

AdGuard Ukrainian filter

  • Purpose: this filter blocks various kinds of ads on Ukrainian-language sites.
  • Ukrainian folder

AdGuard Chinese filter

  • Purpose: this filter blocks various kinds of ads on Chinese-language sites.
  • Chinese folder
  • Notes: The AdGuard Chinese filter includes Easylist China, so there's no need to add rules which are already in Easylist China.

AdGuard Dutch filter

  • Purpose: this filter blocks various kinds of ads on Dutch-language sites.
  • Dutch folder

AdGuard French filter

  • Purpose: this filter blocks various kinds of ads on French-language sites.
  • French folder
  • Notes: The AdGuard French filter includes Liste FR, so there's no need to add rules which are already in Liste FR.

AdGuard German filter

  • Purpose: this filter blocks various kinds of ads on German-language sites.
  • German folder
  • Notes: The AdGuard German filter includes Easylist Germany, so there's no need to add rules which are already in Easylist Germany.

AdGuard Japanese filter

  • Purpose: this filter blocks various kinds of ads on Japanese-language sites.
  • Japanese folder

AdGuard Spanish filter

  • Purpose: this filter blocks various kinds of ads on Spanish-language and Portuguese-language sites.
  • Spanish folder

AdGuard Turkish filter

  • Purpose: this filter blocks various kinds of ads on Turkish-language sites.
  • Turkish folder

AdGuard Quick Fixes filter

  • Purpose: This filter serves as a quick-response solution, ensuring that AdGuard MV3 extension users experience minimal disruption while awaiting updates of the extension with static filters.
  • Quick Fixes folder
  • Notes: Used in MV3 extension only.