Doc: Document rules
This commit is contained in:
@@ -14,6 +14,54 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
Use this rule to control the number of spaces inside braces (``{`` and ``}``).
|
||||
|
||||
.. rubric:: Options
|
||||
|
||||
* ``min-spaces-inside`` defines the minimal number of spaces required inside
|
||||
braces.
|
||||
* ``max-spaces-inside`` defines the maximal number of spaces allowed inside
|
||||
braces.
|
||||
|
||||
.. rubric:: Examples
|
||||
|
||||
#. With ``braces: {min-spaces-inside: 0, max-spaces-inside: 0}``
|
||||
|
||||
the following code snippet would **PASS**:
|
||||
::
|
||||
|
||||
object: {key1: 4, key2: 8}
|
||||
|
||||
the following code snippet would **FAIL**:
|
||||
::
|
||||
|
||||
object: { key1: 4, key2: 8 }
|
||||
|
||||
#. With ``braces: {min-spaces-inside: 1, max-spaces-inside: 3}``
|
||||
|
||||
the following code snippet would **PASS**:
|
||||
::
|
||||
|
||||
object: { key1: 4, key2: 8 }
|
||||
|
||||
the following code snippet would **PASS**:
|
||||
::
|
||||
|
||||
object: { key1: 4, key2: 8 }
|
||||
|
||||
the following code snippet would **FAIL**:
|
||||
::
|
||||
|
||||
object: { key1: 4, key2: 8 }
|
||||
|
||||
the following code snippet would **FAIL**:
|
||||
::
|
||||
|
||||
object: {key1: 4, key2: 8 }
|
||||
"""
|
||||
|
||||
|
||||
import yaml
|
||||
|
||||
from yamllint.rules.common import spaces_after, spaces_before
|
||||
|
||||
Reference in New Issue
Block a user