Skip to content

Commit

Permalink
fix yaml requirement & readme link
Browse files Browse the repository at this point in the history
  • Loading branch information
OnGle committed Feb 22, 2023
1 parent 93db514 commit 1791e63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ E.g.
``tkldev-detective lint zoneminder``

For more information on how it works and how to develop more functionality, see
`overview`_, `custom modules`_ and `tools and tricks.rst`_
`overview`_, `custom modules`_ and `tools and tricks`_

Copyright
---------
Expand Down
12 changes: 9 additions & 3 deletions tkldet_modules/yaml_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@
#
# You should have received a copy of the GNU General Public License along with
# tkldev-detective. If not, see <https://www.gnu.org/licenses/>.
import yaml
try:
import yaml
except ImportError:
YAML = False
else:
YAML = True
from typing import Generator

from libtkldet.linter import FileLinter, FileItem, register_linter
from libtkldet.report import Report, FileReport, ReportLevel


@register_linter
class YamlLinter(FileLinter):
ENABLE_TAGS: set[str] = {"ext:yaml", "ext:yml"}
DISABLE_TAGS: set[str] = set()
Expand Down Expand Up @@ -55,3 +58,6 @@ def check(self, item: FileItem) -> Generator[Report, None, None]:
source="yaml_check",
level=ReportLevel.ERROR,
)

if YAML:
register_linter(YamlLinter)

0 comments on commit 1791e63

Please sign in to comment.