Skip to content

How to add a check?

Corentin Bettiol edited this page Nov 12, 2019 · 14 revisions

Each check is a file located in the checks/ folder (see wiki - How does it work?), and need to follow some guidelines:


Functions

importance()

This is the function that tells launch_checks if the current check must be performed before the others, or if it doesn't matter.

Its sole purpose is to return an int (the recommended use is between 1 and 5).

The higher the number, the faster the function will be executed.

Since check_keywords populates the site.keywords var, it need to be executed before all the functions that will use site.keywords var.

run()

This is the main function of your file, the one that will do the check and that will populate the site.warnings and/or site.problems lists.


Problems & warnings

coming soon (the code will soon change, I don't want to write something obsolete)


So to add a new check, simply create a file inside checks/ folder, and be sure to provide importance() & run() functions.

Take a look at the check_h1.py files to understand how checks are managed.

Clone this wiki locally