Nomenclature#

This is the nomenclature about manifest references names (rules and properties).

  • A rule name starts with a prefix from RULE_BASE_PREFIX;

  • Rule prefix is followed from its type that can be either:

    • The RULE_META value;

    • reference string;

  • Then rule name ends with its component name;

  • Rule name parts are separated with -.

There is a limited set of allowed characters:

  • For rule component name they are registred in RULE_ALLOWED_CHARS;

  • For rule property name they are registred in PROPERTY_ALLOWED_CHARS;

There is some reserved name:

  • For rule component name they are registred in RESERVED_RULE_NAMES;

  • For rule property name they are registred in RESERVED_PROPERTY_NAMES;

py_css_styleguide.nomenclature.FORBIDDEN_PREFIXES = ('_', '-')#

Rule and property names can not start with following strings

py_css_styleguide.nomenclature.RESERVED_RULE_NAMES = ('styleguide', 'load', 'to_dict', 'to_json', 'from_dict', 'metas')#

Rule name can not be one of the following string

py_css_styleguide.nomenclature.RESERVED_PROPERTY_NAMES = ('structure',)#

Property (variable) name can not be one of the following string

py_css_styleguide.nomenclature.REFERENCE_STRUCTURES = ('flat', 'list', 'string', 'number', 'json', 'object-complex', 'nested')#

Tuple of available reference structures. Structure name json is deprecated and supersed by name object-complex.

py_css_styleguide.nomenclature.is_reserved_rule(name)[source]#

Validate name against RESERVED_RULE_NAMES.

Parameters:

name (string) – Rule name.

Returns:

True if name match a reserved name.

Return type:

bool

py_css_styleguide.nomenclature.is_reserved_property(name)[source]#

Validate name against RESERVED_PROPERTY_NAMES.

Parameters:

name (string) – Property name.

Returns:

True if name match a reserved name.

Return type:

bool

py_css_styleguide.nomenclature.is_valid_rule(name)[source]#

Validate rule name.

Parameters:

name (string) – Rule name.

Returns:

True if rule name is valid.

Return type:

bool

py_css_styleguide.nomenclature.is_valid_property(name)[source]#

Validate property name.

Parameters:

name (string) – Property name.

Returns:

True if variable name is valid.

Return type:

bool