Skip to content

Commit

Permalink
rev(rule210): Resolve causing a lot of false positives
Browse files Browse the repository at this point in the history
As reported in #299

Signed-off-by: Jeffrey Bouter <jeffrey.bouter@warpnet.nl>
  • Loading branch information
jbouter committed Jan 16, 2023
1 parent 2e9762d commit 1e3ce73
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes in **salt-lint** are documented below.

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).

## [0.9.1] (2023-01-16)
### Fixed
- Revert changes to rule 210 ([!299](https://github.com/warpnet/salt-lint/issues/299))

## [0.9.0] (2023-01-13)
### Added
- Rule 219 for catching missing over-indentation of nested dicts ([#284](https://github.com/warpnet/salt-lint/pull/284)).
Expand Down Expand Up @@ -50,7 +54,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Rules 901-915 to check for deprecated states and state options ([#214](https://github.com/warpnet/salt-lint/pull/214)).
- 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)).

[Unreleased]: https://github.com/warpnet/salt-lint/compare/v0.9.0...HEAD
[Unreleased]: https://github.com/warpnet/salt-lint/compare/v0.9.1...HEAD
[0.9.1]: https://github.com/warpnet/salt-lint/compare/v0.9.0...v0.9.1
[0.9.0]: https://github.com/warpnet/salt-lint/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/warpnet/salt-lint/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/warpnet/salt-lint/compare/v0.6.1...v0.7.0
Expand Down
2 changes: 1 addition & 1 deletion saltlint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

NAME = 'salt-lint'
VERSION = '0.9.0'
VERSION = '0.9.1'
DESCRIPTION = __doc__

__author__ = 'Warpnet B.V.'
Expand Down
2 changes: 1 addition & 1 deletion saltlint/rules/YamlHasOctalValueRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class YamlHasOctalValueRule(Rule):
tags = ['formatting']
version_added = 'v0.0.6'

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

def match(self, file, line):
return self.bracket_regex.search(line)
13 changes: 1 addition & 12 deletions tests/unit/TestYamlHasOctalValueRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,9 @@
# MAC addresses shouldn't be matched, for more information see:
# https://github.com/warpnet/salt-lint/issues/202
infoblox_remove_record1:
infoblox_remove_record:
infoblox_host_record.absent:
- mac: 4c:f2:d3:1b:2e:05
infoblox_remove_record2:
infoblox_host_record.absent:
- mac: 05:f2:d3:1b:2e:4c
# Time values should not trigger this rule
some_calendar_entry:
file.managed:
- name: /tmp/my_unit_file
- contents: |
OnCalendar=Sun 18:00
'''

BAD_NUMBER_STATE = '''
Expand Down

0 comments on commit 1e3ce73

Please sign in to comment.