Configuration

March 6, 2022 ยท View on GitHub

duck can be customized with with a .duck.toml file in your project's directory.

Creating a configuration file

To create a new configuration file, navigate in your terminal to the directory of your project and run the following command:

duck new-config

This will create a file called .duck.toml in your project's directory that will be used on subsequent runs of duck. Opening this file will reveal many pre-set properties, some of which you may be able to able to adjust without any instruction. Either way, a full list of the possible values your config can hold are below.

Setting lint levels

You can additionally section called [lint_levels] to specify global lint levels for specific lints. You can see a working example of this here.

Configuration options

PropertyPossible ValuesExplanation
todo_keywordAny stringThe name of a function in your code base used to mark something as unfinished. Used by todo.
max_argumentsAny numberThe maximum number of arguments the associated lint will allow. Used by too_many_arguments.
statement_parentheticalstrue, falseWhether or not statements should have parenthesis over their condition (ex: if (foo) vs if foo). Used by statement_parenthetical_violation.
var_prefixestrue, falseWhether or not local variables should be prefixed with an underscore (ex: var _foo vs var foo). Used by var_prefix_violation.
english_flavor"american", "british"The spelling of English words you prefer for GameMaker functions (ex: color vs colour). Used by english_flavor_violation.
length_enum_member_nameAny stringA name to ignore in enums that denote its length (ie: Len, Count). Used by missing_case_member.
prefer_and_keywordtrue, falseWhether or not the and_preference lint should require the and keyword or the && symbol.
prefer_or_keywordtrue, falseWhether or not the or_preference lint should require the or keyword or the || symbol
prefer_mod_keywordtrue, falseWhether or not the mod_preference lint should require the mod keyword or the % symbol.
prefer_not_keywordtrue, falseWhether or not the not_preference lint should require the not keyword or the ! symbol.