Giter VIP home page Giter VIP logo

Comments (3)

andrewimeson avatar andrewimeson commented on June 9, 2024

As another alternative: you can override a rule that defaults as a warning to be an error

extends: default

rules:
  comments:
    level: error

I do like the idea of adding top level configuration key like strict: true.

from yamllint.

adrienverge avatar adrienverge commented on June 9, 2024

Hello,

I allowed myself to rename the issue title, because most command-line flags (-h, -c, -d, -v, --list-files...) aren't meant for that.

Related to #348.

I'm still not a fan of allowing strict: true or no-warnings: true in configuration, because in my opinion these are flags for temporarily altering the output (using command line), while static customizations should define level: error|warning permanently in the configuration file. But I note you and @andrewimeson like the idea! I'm curious to know how many people would use this feature.

from yamllint.

jamesquilty avatar jamesquilty commented on June 9, 2024

I'm happy with the Issue title change to focus on the strict flag. What I would like to to is permanently set the exit code behaviour of yamllint. My context is for use with pre-commit, but it would also apply to other contexts where the exit code is tested.

Setting level: error for the four rules in the default configuration which have level: warning set is an indirect way of influencing the exit code behaviour and has some undesirable features from my point-of-view:

  • I agree with the idea of level:, that some rule violations are more severe than others, and making everything an error for the purpose of influencing the exit code will remove that distinction.
  • When a new rule with level: warning is added to the default configuration any violations won't be detected by automated processes if --strict is not used.
  • If/when I happen to notice a new rule with level: warning has been introduced then I'll have to manually update every .yamllint file which will be error-prone toil.

Setting level: error is certainly feasible, but due to the three points above I would still find myself motivated to permanently set the --strict flag.

Adrien, there's only one rigorous way to satisfy your curiosity: implement a config file setting for strict and then survey public repos to see how many people use it 😄

from yamllint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.