Skip to content

Commit

Permalink
fix(default.yaml): disable empty-values & octal-values by default
Browse files Browse the repository at this point in the history
* Close #204
  • Loading branch information
myii authored and adrienverge committed Oct 15, 2019
1 parent 579a975 commit 7359785
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions tests/rules/test_octal_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def test_disabled(self):
self.check('user-city: 0o10', conf)

def test_implicit_octal_values(self):
conf = ('octal-values: {forbid-implicit-octal: true}\n'
conf = ('octal-values:\n'
' forbid-implicit-octal: true\n'
' forbid-explicit-octal: false\n'
'new-line-at-end-of-file: disable\n'
'document-start: disable\n')
self.check('user-city: 010', conf, problem=(1, 15))
Expand All @@ -50,7 +52,9 @@ def test_implicit_octal_values(self):
' - 0e3\n', conf)

def test_explicit_octal_values(self):
conf = ('octal-values: {forbid-explicit-octal: true}\n'
conf = ('octal-values:\n'
' forbid-implicit-octal: false\n'
' forbid-explicit-octal: true\n'
'new-line-at-end-of-file: disable\n'
'document-start: disable\n')
self.check('user-city: 0o10', conf, problem=(1, 16))
Expand Down
4 changes: 2 additions & 2 deletions yamllint/conf/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ rules:
document-start:
level: warning
empty-lines: enable
empty-values: enable
empty-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length: enable
new-line-at-end-of-file: enable
new-lines: enable
octal-values: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
Expand Down
4 changes: 2 additions & 2 deletions yamllint/rules/empty_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
TYPE = 'token'
CONF = {'forbid-in-block-mappings': bool,
'forbid-in-flow-mappings': bool}
DEFAULT = {'forbid-in-block-mappings': False,
'forbid-in-flow-mappings': False}
DEFAULT = {'forbid-in-block-mappings': True,
'forbid-in-flow-mappings': True}


def check(conf, token, prev, next, nextnext, context):
Expand Down
4 changes: 2 additions & 2 deletions yamllint/rules/octal_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
TYPE = 'token'
CONF = {'forbid-implicit-octal': bool,
'forbid-explicit-octal': bool}
DEFAULT = {'forbid-implicit-octal': False,
'forbid-explicit-octal': False}
DEFAULT = {'forbid-implicit-octal': True,
'forbid-explicit-octal': True}


def check(conf, token, prev, next, nextnext, context):
Expand Down

0 comments on commit 7359785

Please sign in to comment.