-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for tox with pylint, pyunit, flake8, black, shellcheck #15
Conversation
2c74c32
to
a519280
Compare
@nhosoi this will give you the ability to do linting/formatting of your python file, and the ability to do unit testing of your functions e.g. you could create a unit test like # SPDX-License-Identifier: GPL-2.0-or-later
"""unit tests for lsr_role2collection"""
import unittest
import lsr_role2collection
class LSRRole2Collection(unittest.TestCase):
"""test lsr_role2collection"""
def test_add_rolename(self):
"""test add_rolename"""
result = lsr_role2collection.add_rolename("README.md", "rolename")
self.assertEqual("README-rolename.md", result)
... more tests for this ...
def test_for_other_funcs(self):
"""tests for other funcs""""
.... |
@nhosoi note that if you use this, you will have to rename the python script to be lsr_role2collection.py |
Thank you, @richm!!
|
You have to install shellcheck manually since it isn't a python pypi package:
|
Nice. Thanks! (did you know dnf is case sensitive? Even worse,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
add support for tox with pylint, pyunit, flake8, black, shellcheck
added a check for shellcheck - if it is not in your PATH, you will get an error message like this: |
@nhosoi is this latest commit working for you? |
Yes, it is. My approval is for the latest commit you mentioned. Please merge this pr. |
add support for tox with pylint, pyunit, flake8, black, shellcheck