From e8ebc8b7ea6e62de2e7fca81ab4fca418d0ee0d2 Mon Sep 17 00:00:00 2001 From: tssala23 Date: Thu, 1 Feb 2024 13:32:59 -0500 Subject: [PATCH 1/2] Add workflow for linting Signed-off-by: tssala23 --- .github/workflows/linting.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/linting.yaml diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml new file mode 100644 index 0000000..3d1a8d8 --- /dev/null +++ b/.github/workflows/linting.yaml @@ -0,0 +1,10 @@ +name: linter + +on: [ push, pull_request ] + +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: chartboost/ruff-action@v1 \ No newline at end of file From 333bf325bdfe76dc4d029478f22ce908e8f1926f Mon Sep 17 00:00:00 2001 From: tssala23 Date: Tue, 6 Feb 2024 12:07:25 -0500 Subject: [PATCH 2/2] Fix linting errors reported by ruff Signed-off-by: tssala23 --- slack_notifier/notifier.py | 2 -- tests/test_notifier.py | 1 - 2 files changed, 3 deletions(-) diff --git a/slack_notifier/notifier.py b/slack_notifier/notifier.py index 421b0b1..f21a24f 100644 --- a/slack_notifier/notifier.py +++ b/slack_notifier/notifier.py @@ -2,8 +2,6 @@ import git import ansible_runner import os -import requests -import json import logging import slack_notifier.slack as slack import slack_notifier.github as github diff --git a/tests/test_notifier.py b/tests/test_notifier.py index 685b85f..3535ad6 100644 --- a/tests/test_notifier.py +++ b/tests/test_notifier.py @@ -1,7 +1,6 @@ from unittest.mock import patch, Mock import pytest import slack_notifier.notifier as notifier -from pathlib import Path notify_with_vlan_change = { "commits": [{"modified": ["group_vars/all/vlans.yaml"]}],