From 7359785ea07e117a923a7debb92376192ed633e9 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Thu, 10 Oct 2019 23:40:07 +0100 Subject: [PATCH] fix(default.yaml): disable `empty-values` & `octal-values` by default * Close #204 --- tests/rules/test_octal_values.py | 8 ++++++-- yamllint/conf/default.yaml | 4 ++-- yamllint/rules/empty_values.py | 4 ++-- yamllint/rules/octal_values.py | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/rules/test_octal_values.py b/tests/rules/test_octal_values.py index 7e82d4e..f2d9a2b 100644 --- a/tests/rules/test_octal_values.py +++ b/tests/rules/test_octal_values.py @@ -28,7 +28,9 @@ class OctalValuesTestCase(RuleTestCase): 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)) @@ -50,7 +52,9 @@ class OctalValuesTestCase(RuleTestCase): ' - 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)) diff --git a/yamllint/conf/default.yaml b/yamllint/conf/default.yaml index dc4adf1..0720ded 100644 --- a/yamllint/conf/default.yaml +++ b/yamllint/conf/default.yaml @@ -18,7 +18,7 @@ rules: document-start: level: warning empty-lines: enable - empty-values: enable + empty-values: disable hyphens: enable indentation: enable key-duplicates: enable @@ -26,7 +26,7 @@ rules: 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: diff --git a/yamllint/rules/empty_values.py b/yamllint/rules/empty_values.py index 14bd0e0..bb4982b 100644 --- a/yamllint/rules/empty_values.py +++ b/yamllint/rules/empty_values.py @@ -75,8 +75,8 @@ ID = 'empty-values' 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): diff --git a/yamllint/rules/octal_values.py b/yamllint/rules/octal_values.py index 40de39a..f6e80ce 100644 --- a/yamllint/rules/octal_values.py +++ b/yamllint/rules/octal_values.py @@ -66,8 +66,8 @@ ID = 'octal-values' 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):