Skip to content

Commit 8f6cfd1

Browse files
authored
Merge pull request #27 from digitronik/enhance_nox
RFR: Enhancement in nox
2 parents 8f1d8c4 + 6106a9f commit 8f6cfd1

File tree

6 files changed

+50
-17
lines changed

6 files changed

+50
-17
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ jobs:
4343
python-version: ${{ matrix.python-version }}
4444
architecture: x64
4545

46-
- name: Install nox
47-
run: python -m pip install nox
46+
- name: Setup Package and Install Devel Dependencies
47+
run: |
48+
python -m pip install -Ur dev-requirements.txt
49+
python -m pip install .
4850
49-
- name: Run nox
50-
run: nox
51+
- name: Unit Tests
52+
run: py.test -v tests

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
repos:
22
- repo: https://github.com/asottile/reorder_python_imports
3-
rev: v1.6.1
3+
rev: v1.9.0
44
hooks:
55
- id: reorder-python-imports
66
language_version: python3
77
- repo: https://github.com/psf/black
8-
rev: 19.3b0
8+
rev: 19.10b0
99
hooks:
1010
- id: black
1111
args: [--safe, --quiet, --line-length, "100"]
1212
language_version: python3
1313
require_serial: true
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v2.2.3
15+
rev: v2.5.0
1616
hooks:
1717
- id: flake8
1818
verbose: true
1919
- repo: https://github.com/pre-commit/pre-commit-hooks
20-
rev: v2.3.0
20+
rev: v2.5.0
2121
hooks:
2222
- id: trailing-whitespace
2323
language_version: python3
@@ -28,7 +28,7 @@ repos:
2828
- id: flake8
2929
language_version: python3
3030
- repo: https://github.com/asottile/pyupgrade
31-
rev: v1.22.1
31+
rev: v1.26.2
3232
hooks:
3333
- id: pyupgrade
3434
language_version: python3

CONTRIBUTING.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,22 @@ When contributing to linkstatus, we ask that you:
5151
# Setting up the environment
5252

5353
Below is the steps for setting up a development environment
54-
```
54+
```shell
5555
git clone https://github.com/pythonpune/linkstatus
5656
cd linkstatus
5757
virtualenv .venv
5858
source .venv/bin/activate
59-
pip install -e .
59+
python -m pip install -Ur dev-requirements.txt
60+
python -m pip install -e .
6061
linkstatus --help
6162
```
6263

64+
# Run unit test with nox
65+
```shell
66+
nox --list # list all available sessions
67+
nox -s pre_commit # run pre-commit checks
68+
nox -s tests # run unit tests
69+
```
6370
# Your First Contribution
6471

6572
- Unsure where to begin contributing? You can start by looking through these beginner and help-wanted issues:

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,27 @@ Options:
3939
-t, --timeout INTEGER Request timeout (default 4 second)
4040
-rt, --retry INTEGER Retry link status (default 2 time)
4141
--help Show this message and exit.
42-
```
4342
44-
![linkstatus](https://user-images.githubusercontent.com/11618054/67764478-0fcec100-fa70-11e9-9c3c-04c1f432f620.png)
43+
44+
❯❯❯ linkstatus tests/data/markdown_file.md
45+
Links in File: 'tests/data/markdown_file.md'
46+
✓ L4 : https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
47+
✓ L8 : http://www.google.com
48+
✓ L10 : https://www.google.com
49+
✓ L12 : https://github.com/pythonpune/linkstatus
50+
✓ L24 : http://www.example.com
51+
✗ L34 : https://github.com/pythonpune/linkcheck (404)
52+
✓ L39 : https://github.com//pythonpune/
53+
… L41 : http://<hostname>:<port> (skip)
54+
… L43 : https://<hostname>:<port>/pages (skip)
55+
=================================================================================================================
56+
Links Status Summary
57+
Links UP: 6
58+
Links SKIP: 2
59+
Links DOWN: 1
60+
Warning: Use `noqa` inline comment to skip link check. like, response code 403 due to header restrictions etc...
61+
=================================================================================================================
62+
```
4563

4664

4765
**Note: Skip link check for any line by adding `noqa` (no quality assurance) as inline comment

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
nox
12
pre-commit
23
pytest
34
ruamel.yaml

noxfile.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33

44
@nox.session
5-
def run_tests(session):
6-
session.install("-r", "dev-requirements.txt")
7-
session.install("-e", ".")
8-
session.run("pytest", "tests")
5+
def pre_commit(session):
6+
session.install("pre-commit")
7+
session.run("pre-commit", "run", "-a")
8+
9+
10+
@nox.session(python=["3.6", "3.7"])
11+
def tests(session):
12+
session.install("pytest", "ruamel.yaml", ".")
13+
session.run("pytest", "-sqvv", "tests")

0 commit comments

Comments
 (0)