mirror of
https://github.com/drewkerrigan/nagios-http-json.git
synced 2024-11-25 03:43:50 +01:00
Merge pull request #78 from drewkerrigan/docs/update-repo
Update Makefile and Workflows
This commit is contained in:
commit
9626fc4464
15
.github/workflows/unittest.yml
vendored
15
.github/workflows/unittest.yml
vendored
@ -7,21 +7,20 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [3.6, 3.7, 3.8]
|
python-version: [3.8, 3,9]
|
||||||
name: GitHub Action
|
name: GitHub Action
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install -r requirements-dev.txt
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: |
|
run: |
|
||||||
pip3 install --upgrade pip wheel setuptools
|
make lint
|
||||||
pip3 install pylint
|
|
||||||
python3 -m pylint check_http_json.py
|
|
||||||
- name: Unit Test
|
- name: Unit Test
|
||||||
run: |
|
run: |
|
||||||
python3 -m unittest discover
|
make test
|
||||||
- name: Coverage
|
- name: Coverage
|
||||||
run: |
|
run: |
|
||||||
pip3 install coverage
|
make coverage
|
||||||
python3 -m coverage run -m unittest discover
|
|
||||||
python3 -m coverage report -m --include check_http_json.py
|
|
||||||
|
20
.pylintrc
20
.pylintrc
@ -1,5 +1,21 @@
|
|||||||
# pylint config
|
# pylint config
|
||||||
[MESSAGES CONTROL]
|
|
||||||
disable=line-too-long, redefined-outer-name, too-many-arguments, too-many-instance-attributes, fixme, invalid-name, superfluous-parens, missing-function-docstring, missing-module-docstring, multiple-imports, no-else-return, too-many-return-statements, too-many-branches, too-many-statements
|
|
||||||
[MASTER]
|
[MASTER]
|
||||||
ignore-patterns=^test.*
|
ignore-patterns=^test.*
|
||||||
|
|
||||||
|
[MESSAGES CONTROL]
|
||||||
|
disable=fixme,
|
||||||
|
consider-using-f-string,
|
||||||
|
invalid-name,
|
||||||
|
line-too-long,
|
||||||
|
missing-function-docstring,
|
||||||
|
missing-module-docstring,
|
||||||
|
multiple-imports,
|
||||||
|
no-else-return,
|
||||||
|
redefined-outer-name,
|
||||||
|
superfluous-parens,
|
||||||
|
too-many-locals,
|
||||||
|
too-many-arguments,
|
||||||
|
too-many-branches,
|
||||||
|
too-many-instance-attributes,
|
||||||
|
too-many-return-statements,
|
||||||
|
too-many-statements
|
||||||
|
9
Makefile
Normal file
9
Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.PHONY: lint test coverage
|
||||||
|
|
||||||
|
lint:
|
||||||
|
python -m pylint check_http_json.py
|
||||||
|
test:
|
||||||
|
python -m unittest discover
|
||||||
|
coverage:
|
||||||
|
python -m coverage run -m unittest discover
|
||||||
|
python -m coverage report -m --include check_http_json.py
|
@ -609,6 +609,7 @@ def main(cliargs):
|
|||||||
databytes = str(args.data).encode()
|
databytes = str(args.data).encode()
|
||||||
response = urllib.request.urlopen(req, data=databytes, context=context)
|
response = urllib.request.urlopen(req, data=databytes, context=context)
|
||||||
else:
|
else:
|
||||||
|
# pylint: disable=consider-using-with
|
||||||
response = urllib.request.urlopen(req, context=context)
|
response = urllib.request.urlopen(req, context=context)
|
||||||
|
|
||||||
json_data = response.read()
|
json_data = response.read()
|
||||||
|
9
makefile
9
makefile
@ -1,9 +0,0 @@
|
|||||||
.PHONY: lint test coverage
|
|
||||||
|
|
||||||
lint:
|
|
||||||
python3 -m pylint check_http_json.py
|
|
||||||
test:
|
|
||||||
python3 -m unittest discover
|
|
||||||
coverage:
|
|
||||||
python3 -m coverage run -m unittest discover
|
|
||||||
python3 -m coverage report -m --include check_http_json.py
|
|
2
requirements-dev.txt
Normal file
2
requirements-dev.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
coverage==6.4.4
|
||||||
|
pylint==2.15.2
|
Loading…
Reference in New Issue
Block a user