README.md 1.7 KB
Newer Older
D
Dan Bader 已提交
1
# Real Python Materials
D
Dan Bader 已提交
2

D
Dan Bader 已提交
3
Bonus materials, exercises, and example projects for Real Python's [Python tutorials](https://realpython.com).
D
Dan Bader 已提交
4 5

Build Status: [![CircleCI](https://circleci.com/gh/realpython/materials.svg?style=svg)](https://circleci.com/gh/realpython/materials)
D
Dan Bader 已提交
6

D
Dan Bader 已提交
7 8 9 10 11 12 13 14 15
## Got a Question?

The best way to get support for Real Python courses & articles and code in this repository is to join one of our [weekly Office Hours calls](https://realpython.com/office-hours/) or to ask your question in the [RP Community Slack](https://realpython.com/community/). 

Due to time constraints we cannot provide 1:1 support via GitHub. See you on Slack or on the next Office Hours call 🙂

## Adding Source Code & Sample Projects to This Repo (RP Contributors)

### Running Code Style Checks
D
Dan Bader 已提交
16 17 18 19 20 21 22 23 24 25

We use [flake8](http://flake8.pycqa.org/en/latest/) and [black](https://github.com/ambv/black) to ensure a consistent code style for all of our sample code in this repository.

Run the following commands to validate your code against the linters:

```sh
$ flake8
$ black --check .
```

D
Dan Bader 已提交
26
### Running Python Code Formatter
D
Dan Bader 已提交
27

D
Dan Bader 已提交
28 29 30 31
We're using a tool called [black](https://github.com/ambv/black) on this repo to ensure consistent formatting. On CI it runs in "check" mode to ensure any new files added to the repo are following PEP 8. If you see linter warnings that say something like "would reformat some_file.py" it means black disagrees with your formatting. 

**The easiest way to resolve these errors is to just run Black locally on the code and then committing those changes, as explained below.**

D
Dan Bader 已提交
32 33 34 35 36
To automatically re-format your code to be consistent with our code style guidelines, run [black](https://github.com/ambv/black) in the repository root folder:

```sh
$ black .
```