Lints - Conifg


invalid_value

Code: L-C01
Default Severity: Error
Minimum Severity: Error

Reports on any values in the config that could not be parsed into a valid config value.

Example

Incorrect

class MyClass {
    data = 1.0.0; // invalid value, should be quoted
};

Correct

class MyClass {
    data = "1.0.0";
};

Explanation

Arma configs only support Strings, Numbers, and Arrays. While other tools would guess that 1.0.0 is a string (often called auto-quote), this behaviour can introduce unintentional mistakes and is not supported by HEMTT.


duplicate_property

Code: L-C02
Default Severity: Error
Minimum Severity: Error

Reports on duplicated properties.

Example

Incorrect

class MyClass {
    data = 1;
    data = 2;
};

Incorrect

class MyClass {
    data = 1;
    class data {
        value = 1;
    };
};

Explanation

Properties on a class must be unique, regardless of the type of property.


duplicate_classes

Code: L-C03
Default Severity: Error
Minimum Severity: Error

Reports on duplicated child classes.

Example

Incorrect

class MyClass {
    class data {
        value = 1;
    };
    class data {
        value = 2;
    };
};

Incorrect

class MyClass {
    class child;
    class child {
        value = 1;
    };
};

Explanation

Children classes can only be defined once in a class.


external_missing

Code: L-C04
Default Severity: Error
Minimum Severity: Error

Reports on classes that extend an external class that is not present in the config

Example

Incorrect

class MyClass: ExternalClass {
    value = 1;
};

Correct

class ExternalClass;
class MyClass: ExternalClass {
    value = 1;
};

Explanation

Classes that extend an external class must be declared in the config.

Read more about class inheritance.


external_parent_case

Code: L-C05
Default Severity: Warning
Minimum Severity: Help

Reports on uses of base classes with incorrect case compared to the parent definition

Example

Incorrect

class BaseClass {};
class MyClass: baseclass {};

Correct

class BaseClass {};
class MyClass: BaseClass {};

Explanation

While Arma does not care about the case of class names, HEMTT wants you to have pretty code.


unexpected_array

Code: L-C06
Default Severity: Error
Minimum Severity: Error

Reports on properties that are not expected to be arrays, but are defined as arrays

Example

Incorrect

class MyClass {
    data = {1, 2, 3};
};

Correct

class MyClass {
    data[] = {1, 2, 3};
};

Explanation

Arrays in Arma configs are denoted by [] after the property name.


expected_array

Code: L-C07
Default Severity: Error
Minimum Severity: Error

Reports on properties that are expected to be arrays, but are not defined as arrays

Example

Incorrect

class MyClass {
    data[] = 1;
};

Correct

class MyClass {
    data = 1;
};

Explanation

Only properties that are arrays must have [] after the property name.


missing_semicolon

Code: L-C08
Default Severity: Error
Minimum Severity: Error

Reports on properties that are missing a semicolon

Example

Incorrect

class MyClass {
    data = 1
};

Correct

class MyClass {
    data = 1;
};

Incorrect

class MyClass {
    data = 1;
}

Correct

class MyClass {
    data = 1;
};

Explanation

All properties must end with a semicolon, including classes.


magwell_missing_magazine

Code: L-C09
Default Severity: Error
Minimum Severity: Warning

Reports on magazines that are defined in CfgMagazineWells but not in CfgMagazines

Example

Incorrect

class CfgMagazineWells {
    class abe_banana_shooter {
        abe_main[] = {
            "abe_cavendish",
            "abe_plantain",
            "external_banana"
        };
    };
};
class CfgMagazines {
    class abe_cavendish {};
};

Correct

class CfgMagazineWells {
    class abe_banana_shooter {
        abe_main[] = {
            "abe_cavendish",
            "abe_plantain",
            "external_banana"
        };
    };
};
class CfgMagazines {
    class abe_cavendish {};
    class abe_plantain {};
};

Explanation

Magazines defined in CfgMagazineWells that are using the project's prefix (abe in this case) must be defined in CfgMagazines as well. This is to prevent accidental typos or forgotten magazines.


class_missing_braces

Code: L-C10
Default Severity: Error
Minimum Severity: Error

Reports on classes that use inheritance without braces

Example

Incorrect

class External;
class AlsoExternal: External;
class MyClass: AlsoExternal {
    data = 1;
};

Correct

class External;
class AlsoExternal: External {};
class MyClass: AlsoExternal {
    data = 1;
};

Explanation

All classes using inheritance with a parent class must use braces {}, even if the class has no properties.