8000 First commit. Added pre-commit and Black to Pipfile. · tecladocode/python-refresher@5bb3f95 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5bb3f95

Browse files
committed
First commit. Added pre-commit and Black to Pipfile.
0 parents  commit 5bb3f95

File tree

5 files changed

+192
-0
lines changed

5 files changed

+192
-0
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/ambv/black
3+
rev: stable
4+
hooks:
5+
- id: black
6+
language_version: python3.7

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"python.formatting.provider": "black",
3+
"python.pythonPath": "/Users/jslvtr/.local/share/virtualenvs/course-template-JRUUZj0H/bin/python"
4+
}

Pipfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
black = "*"
8+
pre-commit = "*"
9+
10+
[packages]
11+
12+
[requires]
13+
python_version = "3.7"
14+
15+
[pipenv]
16+
allow_prereleases = "true"

Pipfile.lock

Lines changed: 136 additions & 0 deletions
1003D
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Course template
2+
3+
## Set up project
4+
5+
Make sure you have Python3.7 installed.
6+
7+
Then, in a terminal, run:
8+
9+
```
10+
pipenv install
11+
```
12+
13+
### Set up Git Hooks
14+
15+
We have a Git hook config that will run Black formatter on all modified files **before you commit**—that's in case you forget to do so yourself or don't have your IDE set up to format on save (which you should, Black is unintrusive!).
16+
17+
To set up the Git hook:
18+
19+
```
20+
pipenv shell
21+
pre-commit install
22+
```
23+
24+
The first time you commit it may take a little longer than you'd hope, but subsequent commits will be quicker.
25+
26+
## allow_prereleases
27+
28+
The Pipfile has `allow_prereleases = "true"` because for Black this is required. Make sure when installing libraries that the latest stable version is used, but try to avoid using alpha and beta versions where possible.
29+
30+
There are times where it will be unavoidable to use prerelease versions of libraries used in a course to teach actual content. We should discuss them on an individual basis. The reason for this is that if we cover an alpha version of a library, it's likely it will change by the time the course is released.

0 commit comments

Comments
 (0)
0