-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding checklist to fill when commiting.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Commit check list | ||
## Coding Conventions | ||
### Django app | ||
- [ ] An app's name should be short, all-lowercase and not include numbers, dashes, periods, spaces, or special characters. It also, in general, should be the plural of an app's main model, so our `posts` app would have a main model called `Post`. | ||
### Files(Modules) | ||
- [ ] Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability(E.g `test_model.py`) | ||
- [ ] Imports are always put at the top of the file. | ||
- [ ] Imports from the same module should be separated with ' , ' (E.g `from secondery_model import item1, item2`). | ||
### Models(Classes) | ||
- [ ] Models name should be in CapWords(E.g `MyModel` ) | ||
- [ ] **Be careful not to choose a similar name to Django's default models names like `User`** | ||
- [ ] **Variables** and **functions** names should be lowercase, with words separated by underscores(i.e `first_name` and `calc_average`) | ||
- [ ] functions names should be significant. | ||
- [ ] Instance methods should always receive `self` as first argument | ||
- [ ] Class methods should always receive `cls` as first argument | ||
- [ ] Constants should be defined in the module level and be written in capital letters with underscores separating words(E.g `MAX_LENGTH`) | ||
- [ ] Strings should be consistent when using quotes. Use quote or double quote, not both. | ||
### Blank lines | ||
- [ ] Surround top-level function and class definitions with two blank lines. | ||
- [ ] Method definitions inside a class are surrounded by a single blank line. | ||
### Tests | ||
- [ ] Each test should have a comment above it to describe the test's purpose. | ||
- [ ] If the test expect `Exception` use `pytest.rise` | ||
- [ ] To test several invalid value test cases use `parametrize`. | ||
## Run Pytest and flake8 | ||
Inside the vagrant Virtual machine and inside the `/vagrant` folder | ||
- [ ] pipenv run python -m pytest -v | ||
- [ ] pipenv run flake8 --max-line-length 120 |