Skip to main content

automates the fixing of problems reported by yamllint

Project description

Docker Image Kataocda scenario

❔ About

yamlfixer automates the fixing of problems reported by yamllint by parsing its output.

📑 Prerequisites

💡 You can try the install process online thanks to the dedicated Katacoda scenario.

In order for it to work, yamlfixer needs that the following utilities are already installed on your system, in a directory present in your $PATH :

  • Python v3.6 (or higher)
  • yamllint v1.26.3 (or higher)

Then simply install yamlfixer from pypi

python3 -m pip install yamlfixer-opt-nc

🚀 Usage

This software automatically fixes some errors and warnings reported by yamllint.

$ yamlfixer [--debug] [--verbose] [--backup] *.yml - thisfile.yaml

or:

$ yamlfixer [--help] [--version]

This will launch yamllint on each specified filename, then parse its output and try to fix the reported problems. The special filename - means stdin, and is assumed if there's no other filename argument.

If input is read from stdin, the corrected output will be sent to stdout. Other files will be overwritten if needed. Original files, stdin excepted, can be preserved as .orig if the --backup command line option is used.

Diagnostic information is sent to stderr in verbose or debug modes.

This command exits with -2 if yamllint is not available on your system. Otherwise it exits with 0 if all input files either are skipped or successfully pass yamllint strict mode, else -1.

IMPORTANT: Not all problems are fixable by yamlfixer. Due to the fact that yamllint doesn't currently report all faulty lines, yamlfixer might even introduce indentation problems under some circumstances.

⚠️Use at your own risk, you have been warned... ⚠️

🔖 Related contents

📖 Licensing information

Copyright (C) 2021-2022 OPT-NC

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

🧑‍🤝‍🧑 Contact

To contact the authors of this software, simply fill an issue on this project.

OPT-NC, aka Office des Postes et Télécommunications de Nouvelle-Calédonie, has a corporate website on www.opt.nc

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yamlfixer-opt-nc-0.3.0.tar.gz (22.9 kB view hashes)

Uploaded Source

Built Distribution

yamlfixer_opt_nc-0.3.0-py3-none-any.whl (22.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page