Skip to content

Commit 1e3ce73

Browse files
committed
rev(rule210): Resolve causing a lot of false positives
As reported in #299 Signed-off-by: Jeffrey Bouter <jeffrey.bouter@warpnet.nl>
1 parent 2e9762d commit 1e3ce73

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes in **salt-lint** are documented below.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## [0.9.1] (2023-01-16)
7+
### Fixed
8+
- Revert changes to rule 210 ([!299](https://github.com/warpnet/salt-lint/issues/299))
9+
610
## [0.9.0] (2023-01-13)
711
### Added
812
- Rule 219 for catching missing over-indentation of nested dicts ([#284](https://github.com/warpnet/salt-lint/pull/284)).
@@ -50,7 +54,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5054
- Rules 901-915 to check for deprecated states and state options ([#214](https://github.com/warpnet/salt-lint/pull/214)).
5155
- This `CHANGELOG.md` file to be able to list all notable changes for each version of **salt-lint** ([#223](https://github.com/warpnet/salt-lint/pull/223)).
5256

53-
[Unreleased]: https://github.com/warpnet/salt-lint/compare/v0.9.0...HEAD
57+
[Unreleased]: https://github.com/warpnet/salt-lint/compare/v0.9.1...HEAD
58+
[0.9.1]: https://github.com/warpnet/salt-lint/compare/v0.9.0...v0.9.1
5459
[0.9.0]: https://github.com/warpnet/salt-lint/compare/v0.8.0...v0.9.0
5560
[0.8.0]: https://github.com/warpnet/salt-lint/compare/v0.7.0...v0.8.0
5661
[0.7.0]: https://github.com/warpnet/salt-lint/compare/v0.6.1...v0.7.0

saltlint/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
NAME = 'salt-lint'
8-
VERSION = '0.9.0'
8+
VERSION = '0.9.1'
99
DESCRIPTION = __doc__
1010

1111
__author__ = 'Warpnet B.V.'

saltlint/rules/YamlHasOctalValueRule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class YamlHasOctalValueRule(Rule):
1717
tags = ['formatting']
1818
version_added = 'v0.0.6'
1919

20-
bracket_regex = re.compile(r"^.*(?:\s|[^\d]{2}:)0\d+(?:[\s#{]|$)")
20+
bracket_regex = re.compile(r"^[^:]+:\s{0,}0[0-9]{1,}\s{0,}((?={#)|(?=#)|(?=$))")
2121

2222
def match(self, file, line):
2323
return self.bracket_regex.search(line)

tests/unit/TestYamlHasOctalValueRule.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,9 @@
3131
3232
# MAC addresses shouldn't be matched, for more information see:
3333
# https://github.com/warpnet/salt-lint/issues/202
34-
infoblox_remove_record1:
34+
infoblox_remove_record:
3535
infoblox_host_record.absent:
3636
- mac: 4c:f2:d3:1b:2e:05
37-
38-
infoblox_remove_record2:
39-
infoblox_host_record.absent:
40-
- mac: 05:f2:d3:1b:2e:4c
41-
42-
# Time values should not trigger this rule
43-
some_calendar_entry:
44-
file.managed:
45-
- name: /tmp/my_unit_file
46-
- contents: |
47-
OnCalendar=Sun 18:00
4837
'''
4938

5039
BAD_NUMBER_STATE = '''

0 commit comments

Comments
 (0)