Commit Graph

9 Commits (d5afff11af6085382d9237c2587c1406fc9a9e94)

Author SHA1 Message Date
Adrien Vergé ebd6b90d3e anchors: Add new rule to detect undeclared or duplicated anchors
According to the YAML specification [^1]:

- > It is an error for an alias node to use an anchor that does not
  > previously occur in the document.

  The `forbid-undeclared-aliases` option checks that aliases do have a
  matching anchor declared previously in the document. Since this is
  required by the YAML spec, this option is enabled by default.

- > The alias refers to the most recent preceding node having the same
  > anchor.

  This means that having a same anchor repeated in a document is
  allowed. However users could want to avoid this, so the new option
  `forbid-duplicated-anchors` allows that. It's disabled by default.

- > It is not an error to specify an anchor that is not used by any
  > alias node.

  This means that it's OK to declare anchors but don't have any alias
  referencing them. However users could want to avoid this, so a new
  option (e.g. `forbid-unused-anchors`) could be implemented in the
  future. See https://github.com/adrienverge/yamllint/pull/537.

Fixes #395
Closes #420

[^1]: https://yaml.org/spec/1.2.2/#71-alias-nodes
2 years ago
Derek Brown 8ac7d58693 float-values: Add a new rule to check floating-point numbers 3 years ago
Adrien Vergé e864f57d37 docs: Fix missing quoted-strings module in documentation 6 years ago
xieenlong 22e792a433 Feature: checking octal numbers 7 years ago
Greg Dubicki 8537b0a164 Add rule: empty-values, to forbid implicit nulls
only in block mappings for now
7 years ago
Johannes F. Knauf 1543d0e435 New rule key-ordering
closes #67
7 years ago
Adrien Vergé 073462a87d docs(rules): Fix missing truthy rule in index 8 years ago
Adrien Vergé f6bab05e8a Rules: Add the 'key-duplicates' rule 9 years ago
Adrien Vergé 38234a1d3c Doc: Generate documentation with Sphinx
HTML documentation should be built with sphinx. This enables easy
integration with Read The Docs [1]. It can also be generated manually by
running:

    make -C docs html

A man page can be generated by running:

    make -C docs man

[1]: http://yamllint.readthedocs.org/
9 years ago