check_syntax

Syntax checks

These checks verify syntax (schema), in particular for the extra section that is otherwise free-form.

Classes

extra_identifiers_missing_colon(_linter)

Each item in the extra/identifiers section must be of form type:value

extra_identifiers_not_list(_linter)

The extra/identifiers section must be a list

extra_identifiers_not_string(_linter)

Each item in the extra/identifiers section must be a string

extra_skip_lints_not_list(_linter)

The extra/skip-lints section must contain a list

version_constraints_missing_whitespace(_linter)

Packages and their version constraints must be space separated

Documentation

class bioconda_utils.lint.check_syntax.version_constraints_missing_whitespace(_linter)[source]

Packages and their version constraints must be space separated

Example:

host:
    python >=3
check_recipe(recipe)[source]

Execute check on recipe

Override this method in subclasses, using self.message() to issue LintMessage as failures are encountered.

Parameters:

recipe – The recipe under test.

fix(_message, _data)[source]

Attempt to fix the problem

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix

class bioconda_utils.lint.check_syntax.extra_identifiers_not_list(_linter)[source]

The extra/identifiers section must be a list

Example:

extra:
   identifiers:
      - doi:123
check_recipe(recipe)[source]

Execute check on recipe

Override this method in subclasses, using self.message() to issue LintMessage as failures are encountered.

Parameters:

recipe – The recipe under test.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix

class bioconda_utils.lint.check_syntax.extra_identifiers_not_string(_linter)[source]

Each item in the extra/identifiers section must be a string

Example:

extra:
   identifiers:
      - doi:123

Note that there is no space around the colon

requires: List[LintCheck] = [<class 'bioconda_utils.lint.check_syntax.extra_identifiers_not_list'>]

Checks that must have passed for this check to be executed.

check_recipe(recipe)[source]

Execute check on recipe

Override this method in subclasses, using self.message() to issue LintMessage as failures are encountered.

Parameters:

recipe – The recipe under test.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix

class bioconda_utils.lint.check_syntax.extra_identifiers_missing_colon(_linter)[source]

Each item in the extra/identifiers section must be of form type:value

Example:

extra:
   identifiers:
      - doi:123
requires: List[LintCheck] = [<class 'bioconda_utils.lint.check_syntax.extra_identifiers_not_string'>]

Checks that must have passed for this check to be executed.

check_recipe(recipe)[source]

Execute check on recipe

Override this method in subclasses, using self.message() to issue LintMessage as failures are encountered.

Parameters:

recipe – The recipe under test.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix

class bioconda_utils.lint.check_syntax.extra_skip_lints_not_list(_linter)[source]

The extra/skip-lints section must contain a list

Example:

extra:
   skip-lints:
      - should_use_compilers
check_recipe(recipe)[source]

Execute check on recipe

Override this method in subclasses, using self.message() to issue LintMessage as failures are encountered.

Parameters:

recipe – The recipe under test.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix