Commit Graph

106 Commits

Author SHA1 Message Date
Dimitri Papadopoulos
024b5367b6 style: silence pygrep-hooks warnings
PGH004 Use specific rule codes when using `noqa`
2024-01-20 08:58:55 +01:00
gardar
0d7ae7bf6b style: fix section heading
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-01-13 07:19:00 +01:00
gardar
10d6cb3a2c fix: nicer line splits
Co-authored-by: Adrien Vergé <adrienverge@gmail.com>
2024-01-13 07:19:00 +01:00
gardar
0cce1a7b14 fix: code example indents
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-01-13 07:19:00 +01:00
gardar
7b26148217 fix: use correct GitLab name
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-01-13 07:19:00 +01:00
gardar
1c1569554e fix: typo
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-01-13 07:19:00 +01:00
gardar
a03d4a0c4e fix: line-length
Co-authored-by: Adrien Vergé <adrienverge@gmail.com>
2024-01-13 07:19:00 +01:00
gardar
420c814ed9 fix: line-length lint
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-01-13 07:19:00 +01:00
gardar
06581793b3 docs: add GitLab CI / Code Climate example
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-01-13 07:19:00 +01:00
Dimitri Papadopoulos
254a218782 style: Apply new isort (I) rules to existing code 2024-01-08 07:27:06 +01:00
Adrien Vergé
1f79e62a98 docs: Fix new rstcheck errors
Some YAML snippets from the examples were actually invalid.
2023-11-21 22:27:44 +01:00
Georgi Georgiev
e636848ddc
config: Look for configuration file in parent directories
Inspired be ESLint's search, it looks for configuration files in all
parent directories up until it reaches the user's home or root.

closes #571
2023-05-22 17:59:56 +02:00
Adrien Vergé
15eafeb80a build: Migrate from setup.py to pyproject.toml
Using `setup.py` is deprecated and the new recommanded way is to declare
a `pyproject.toml` file (see PEP 517 [^1]).

This commit proposes to use setuptools to achieve that, because
setuptools is already used by yamllint, is standard and referenced by
the official Python packaging documentation [^2], and seems to be the
most lightweight solution. An alternative could have been to use Poetry,
see the dedicated pull request and discussion [^3].

For some period, the `setup.py` file will be kept (although almost
empty), to allow old tools versions to keep working.

Closes https://github.com/adrienverge/yamllint/issues/509.

[^1]: https://peps.python.org/pep-0517/
[^2]: https://packaging.python.org/en/latest/tutorials/installing-packages/
[^3]: https://github.com/adrienverge/yamllint/pull/557
2023-04-21 14:15:53 +02:00
Adrien Vergé
16eae28a50 build: Stop using setup.py to generate documentation
Because `setup.py` is deprecated, let's switch from:

    python setup.py build_sphinx

to:

    make -C docs html

to build Sphinx documentation.

The generated HTML files in `docs/_build/html` are exactly the same (I
compared with `diff -qr`).

Also add `-W` (turn warnings into errors) to the `sphinx-build` options
to keep the previous behavior.
2023-04-14 16:03:32 +02:00
Andrew Imeson
6bfd6756e2 docs: Update links that redirect 2023-03-23 18:50:09 +01:00
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
2023-03-22 10:34:35 +01:00
Andrew Imeson
8aaa226830
docs: Update pre-commit hook example
Update syntax of pre-commit hook docs to work with newer pre-commit versions.

Closes #551, #553
2023-03-22 10:31:20 +01:00
Andrew Imeson
404656394c docs: Explicitly specify language even when it's plain text
rstcheck succeeds with a failure (heh) when there's a code block without
a language specified. This can lead to false negatives as the file is no
longer being checked by rstcheck.

Error:

    An `AttributeError` error occured. This is most propably due to a
    code block directive (code/code-block/sourcecode) without a
    specified language. This may result in a false negative for source:
    'docs/disable_with_comments.rst'. See
    https://rstcheck-core.readthedocs.io/en/latest/faq/#code-blocks-without-language-sphinx
    for more information.  Success! No issues detected.
2023-03-02 18:03:00 +01:00
Okue
06db2af9b0
docs: Fix misleading Python API example
`yamllint.linter.run("example.yaml", yaml_config)` example seems
`yamllint.linter.run` opens a given file.
It's misleading.
2023-01-30 18:04:51 +01:00
Peter Leitzen
fa0bb03f9a
cli: Add --list-files command line option
This option lists the files to lint by yamllint, taking into account `ignore`
and `yaml-files` configuration options.
2023-01-10 18:48:38 +01:00
Matthew Gamble
2a904f8fc1
configuration: Allow using a list of strings in ignore configuration
This may feel more natural for some users, rather than embedding
multiple entries in a multi-line string.
2023-01-10 18:45:09 +01:00
Ville Skyttä
6194a282fc
docs: Spelling and grammar fixes 2022-12-12 19:08:31 +01:00
Dimitri Papadopoulos
5b21a3d9ea Remove Unicode marker before strings
All strings are Unicode in Python 3. No need for u'€', just use '€'.
2022-10-28 07:46:33 +02:00
Dimitri Papadopoulos
5fbf44c203 docs: Fix typos 2022-10-28 07:42:28 +02:00
Adrien Vergé
eb7b7ca627 docs: Fix Sphinx error on non-YAML code snippet
This problem was just introduced by commit cec4f33 "Clarify disable-line
and parser errors, workaround" and produced this error when building
documentation:

    docs/disable_with_comments.rst:120:Could not lex literal_block as
    "yaml". Highlighting skipped.
2022-10-26 16:37:45 +02:00
Andrew Imeson
cec4f3383a cocs: Clarify disable-line and parser errors, workaround
Lots of user confusion expecting `disable-line` to work around parser
errors caused by templating syntax.

Relates to #61, #65, #128, #311, #460, #462
2022-10-24 14:44:05 +02:00
Andrew Imeson
52234b7a46 docs: remove erroneous example text in disable-file 2022-10-24 14:44:05 +02:00
andrewnaguib
2f8ad7003a config: Implement for ignore-from-file option
Closes https://github.com/adrienverge/yamllint/issues/360
Co-authored-by: Adrien Vergé <@adrienverge>
2022-08-10 08:35:40 +02:00
Andrew Imeson
94c1c2bcf2 docs: Update ALE vim plugin link 2022-08-05 18:57:21 +02:00
Andrew Imeson
0130e15c8c docs: Simplify GitHub Actions example 2022-08-05 18:57:21 +02:00
Dimitri Papadopoulos Orfanos
3346843edc
docs: Better compress PNG image 2022-08-05 08:43:55 +02:00
Derek Brown
8ac7d58693 float-values: Add a new rule to check floating-point numbers 2022-07-08 17:21:22 +02:00
Andrew Imeson
34a4f76e8b docs: Remove repeated word 'copyright'
Fixes #476 - credit to @chrillep and @adrienverge
2022-06-24 17:15:21 +02:00
Christian Widlund
695fc5f1f1 docs: Add plugin section for Visual Studio Code 2022-06-22 18:12:56 +02:00
Christian Widlund
632665c3e6 docs: Add plugin section for IntelliJ 2022-06-20 14:47:43 +02:00
Adrien Vergé
89b75b7c05 refactor: Remove UTF-8 headers in Python files
The `# -*- coding: utf-8 -*-` headers were useful for Python 2, and
aren't needed for Python 3 where UTF-8 is the default.

yamllint support of Python 2 was dropped in early 2021, see commit
a3fc64d "End support for Python 2".

Let's drop these headers.
2022-06-09 09:40:06 +02:00
Andrew Imeson
2f423117c1
docs: Attempt to clarify configuration file location
Closes #96, Closes #212
2022-03-24 10:23:39 +01:00
Andrew Imeson
8a320aaf2c Make man page show up in apropos
Set the 'description' attribute so that Sphinx builds the manpage with
the 'NAME' section. This is necessary for `apropos` to be able to find
yamllint

Fixes part of #76
2022-03-21 13:48:34 +01:00
Andrew Imeson
c34c962691 Remove the repeated word "automatically" in GHA doc 2022-03-21 13:48:34 +01:00
Madison Swain-Bowden
4f1bbc33dc
docs: Fix link syntax on integration.rst 2021-12-24 09:34:15 +01:00
Rex Ledesma
0f9dffde23
docs: Add configuration for integration with Arcanist 2020-10-24 13:24:55 +02:00
Andrew Imeson
67cb4eb24d Auto-change output format if GitHub Actions detected 2020-09-23 15:41:25 +02:00
Adrien Vergé
597e88bb7b docs: Make 'yaml-file' config documentation clearer
Related to https://github.com/adrienverge/yamllint/issues/311.
2020-09-02 18:23:51 +02:00
Sorin Sbarnea
d274543b72
docs: Add Python API usage example
Fixes: #297
2020-08-25 20:10:32 +02:00
Wolfgang Walther
b5b436a3a4
Add global "locale" config option and make key-ordering rule locale-aware
Support sorting by locale with strcoll(). Properly handle case and accents.

Note: this is a second implementation, for context see:
https://github.com/adrienverge/yamllint/pull/280
https://github.com/adrienverge/yamllint/issues/285
https://github.com/adrienverge/yamllint/pull/288
2020-07-16 09:34:13 +02:00
Adrien Vergé
9403f1f3ec Revert "Add global "locale" config option"
This reverts commit 9e90c77, because it caused a bug that affected
different people just after being released:
https://github.com/adrienverge/yamllint/issues/285
https://github.com/adrienverge/yamllint/issues/286
2020-07-15 14:48:48 +02:00
Wolfgang Walther
9e90c777cb
Add global "locale" config option and make key-ordering rule locale-aware
Support sorting by locale with strcoll(). Properly handle case and accents.
2020-07-15 11:46:05 +02:00
Adrien Vergé
954fdd5e8f style: Fix 'noqa' for flake8 3.8.0
There was a change in behavior of E402, see:
https://gitlab.com/pycqa/flake8/-/issues/638#note_345108633
2020-07-08 16:27:08 +02:00
Will Badart
278a79f093 Mention YAMLLINT_CONFIG_FILE in the documentation 2020-04-29 09:43:16 +02:00
ffapitalle
8fa9eb3ced Add --no-warnings option to suppress warning messages
Use `--no-warnings` option to hide warning messages. It only shows
problems marked as errors.
2019-12-12 09:12:53 +01:00