Repository: warpnet/salt-lint
Pull request #232 (2021-01-19 18:51:43)

fix: set license badge in README.md
Fix the license badge in the `README.md` file, as GitHub isn't able to detect the license of the project because multiple license files are found.



Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2ff9c18..ba0a0f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,9 @@
 All notable changes in **salt-lint** are documented below.
 
 ## [Unreleased]
+### Fixed
+- Ensure all excluded paths from both the CLI and configuration are passed to the runner ([#231](https://github.com/warpnet/salt-lint/pull/231)).
+
 ## [0.5.0] (2021-01-17)
 ### Added
 - Rule 213 to recommend using cmd.run together with onchanges ([#207](https://github.com/warpnet/salt-lint/pull/207)).
diff --git a/README.md b/README.md
index a4773c7..1f5a6d2 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
 [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/salt-lint?logo=python&logoColor=white&style=for-the-badge)](https://pypi.org/project/salt-lint/)
 [![PyPI - Downloads](https://img.shields.io/pypi/dm/salt-lint?logo=python&logoColor=white&style=for-the-badge)](https://pypi.org/project/salt-lint/)
 [![PyPI - Format](https://img.shields.io/pypi/format/salt-lint?logo=python&logoColor=white&style=for-the-badge)](https://pypi.org/project/salt-lint/)
-[![License](https://img.shields.io/github/license/warpnet/salt-lint?style=for-the-badge)](https://raw.githubusercontent.com/warpnet/salt-lint/main/LICENSE)
+[![PyPI - License](https://img.shields.io/pypi/l/salt-lint?style=for-the-badge)](https://raw.githubusercontent.com/warpnet/salt-lint/main/LICENSE)
 [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/warpnet/salt-lint/tests?label=CI&logo=github&style=for-the-badge)](https://github.com/warpnet/salt-lint/actions)
 [![GitHub contributors](https://img.shields.io/github/contributors/warpnet/salt-lint?logo=github&style=for-the-badge)](https://github.com/warpnet/salt-lint/graphs/contributors)
 
diff --git a/saltlint/linter/runner.py b/saltlint/linter/runner.py
index 752d0e6..5f62e4a 100644
--- a/saltlint/linter/runner.py
+++ b/saltlint/linter/runner.py
@@ -38,7 +38,8 @@ class Runner(object):
             # These will be (potentially) relative paths
             paths = [path.strip() for path in exclude_paths]
             self.exclude_paths = paths + [os.path.abspath(path) for path in paths]
-        self.exclude_paths = []
+        else:
+            self.exclude_paths = []
 
     def is_excluded(self, file_path):
         # Any will short-circuit as soon as something returns True, but will


Test patch:
diff --git a/tests/unit/TestRunner.py b/tests/unit/TestRunner.py
index b1e8e02..0d0ceb2 100644
--- a/tests/unit/TestRunner.py
+++ b/tests/unit/TestRunner.py
@@ -4,6 +4,9 @@
 import unittest
 
 from saltlint.cli import run
+from saltlint.config import Configuration
+from saltlint.linter.runner import Runner
+
 
 class TestRunner(unittest.TestCase):
 
@@ -18,3 +21,16 @@ class TestRunner(unittest.TestCase):
         # expected.
         args = ['tests/test-extension-success.sls']
         self.assertEqual(run(args), 0)
+
+    def test_runner_exclude_paths(self):
+        """
+        Check if all the excluded paths from the configuration are passed to
+        the runner.
+        """
+        exclude_paths = ['first.sls', 'second.sls']
+        config = Configuration(dict(exclude_paths=exclude_paths))
+        runner = Runner([], 'init.sls', config)
+
+        self.assertTrue(
+            any(path in runner.exclude_paths for path in exclude_paths)
+        )