thewatchman icon indicating copy to clipboard operation
thewatchman copied to clipboard

Configuration Examples Included in Missing Entities

Open crawshaws opened this issue 2 years ago • 1 comments

The configuration files I have in my HA instance have "example" keys which have values that do not exist in my instance (as they are used purely as an example)

image

For the "camera.front_door" entity, this is referring to this example:

image

Is there a way to omit scanning certain configuration keys as well as the entities themselves?

crawshaws avatar Jul 19 '22 15:07 crawshaws

I just want to support the idea of making this improvement. Examples seem to be a common source for false positives. E.g. also the scheduler-component (hacs) uses examples in it's services.yaml and each of them that represents a place where an entity should be given causes a false positive in Watchman . Sure they can be configured as ignored, by each user of Watchman, but automatically ignoring lines starting with "example:" in Watchman would be a more user frindly solution.
( e.g. comment_pattern = re.compile(r"\sexample:.|#.*") as line 242 in utils.py would seem to do the trick (I'm NOT a python programmer so I will not make a pull request with such code))

Hiekkaharju avatar Nov 27 '22 12:11 Hiekkaharju