Skip to content

Commit

Permalink
🔨 add lint task to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
brutus committed Aug 3, 2021
1 parent b117fb1 commit 2a2ceae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ PYTHON_VERSION = $(shell cat runtime.txt)
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help setup Makefile
.PHONY: help setup setup-venv setup-pre-commit lint Makefile

setup:
setup: setup-venv setup-pre-commit

setup-venv:
python$(PYTHON_VERSION) -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install --upgrade wheel
.venv/bin/pip install -r requirements.txt

setup-pre-commit:
.venv/bin/pre-commit install --overwrite --install-hooks

lint:
.venv/bin/pre-commit run --all-files

serve:
sphinx-autobuild -b html $(SOURCEDIR) $(BUILDDIR)/html

Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Welcome to our laboratory! :tada:

This is where we host the source code of the official version over at
https://lab.uberspace.de. The lab contains a collection of guides and tips on
<https://lab.uberspace.de>. The lab contains a collection of guides and tips on
how to run specific software on Uberspace 7. Most of the guides are contributed
by users like you! So, if you'd like to change or add something here, you're
more than welcome to do so. Have a look at our [contributing guidelines][] to
Expand All @@ -23,8 +23,8 @@ make setup
### Building

```shell
$ source .venv/bin/activate
$ make clean html
source .venv/bin/activate
make clean html
```

The HTML views are now present in `build/html`.
Expand All @@ -33,19 +33,27 @@ The HTML views are now present in `build/html`.

To build automatically on each change use `sphinx-autobuild`:

```
$ make clean serve
```shell
make clean serve
```

This will start a local webserver on http://127.0.0.1:8000, which always serves
the most recent version.

### Linting

To lint all files, you can use `pre-commit`:

```shell
make lint
```

### Spellcheck

To check the spelling you can use the spell check function of sphinx.

```
$ make spelling
```shell
make spelling
```

## License
Expand Down

0 comments on commit 2a2ceae

Please sign in to comment.