Skip to content
Discussion options

You must be logged in to vote

An update for anyone else who had this issue, thanks to @ssbarnea pointing me in the right direction I was able to get our custom rule working again. Here's a simpler version of it to demonstrate the concept:

import re
from typing import List

from ansiblelint.errors import MatchError
from ansiblelint.file_utils import Lintable
from ansiblelint.rules import AnsibleLintRule


class MatchStringInLineRule(AnsibleLintRule):
    id = '<id goes here>'
    shortdesc = '<short description goes here>'
    description = '<description goes here>'
    severity = 'LOW'
    tags = ['formatting']

    done: List[str] = []

    def matchyaml(self, file: Lintable) -> List[MatchError]:
        # No errors …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Rylon
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Rylon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants