From 47fa25e398ed4ecd89684b21a4ad409d41104810 Mon Sep 17 00:00:00 2001 From: Matan Peretz Date: Sun, 10 Apr 2022 20:24:29 +0300 Subject: [PATCH 1/4] Adding CheckList.md file Adding checklist to fill when commiting. --- docs/CheckList.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/CheckList.md diff --git a/docs/CheckList.md b/docs/CheckList.md new file mode 100644 index 0000000..0c209f0 --- /dev/null +++ b/docs/CheckList.md @@ -0,0 +1,27 @@ +# 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 form the same module should be separated with ' , ' (E.g `from secondery_model import item1, item 2`). +### Models(Classes) + - [ ] Models name should be in CapWords(E.g `MyModel` ) + - [ ] **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 +- [ ] Above each test should have a comment that describes what the test is meant for. +- [ ] 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 \ No newline at end of file From 10f4d7ebaee6e6cb005f8b397d0b3a16a3d4a0b5 Mon Sep 17 00:00:00 2001 From: Matan Peretz Date: Tue, 12 Apr 2022 14:25:59 +0300 Subject: [PATCH 2/4] Adding a section Adding a section to avoid using Django default models name --- docs/CheckList.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/CheckList.md b/docs/CheckList.md index 0c209f0..d8934ce 100644 --- a/docs/CheckList.md +++ b/docs/CheckList.md @@ -8,6 +8,7 @@ - [ ] Imports form the same module should be separated with ' , ' (E.g `from secondery_model import item1, item 2`). ### 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 From dee3038ffb4a4a09a107afd4868e0df113047f40 Mon Sep 17 00:00:00 2001 From: Matan Peretz Date: Tue, 19 Apr 2022 16:28:32 +0300 Subject: [PATCH 3/4] Change line 22 Change line 22 from: `Above each test should have a comment that describes what the test is meant for.` to `Each test should have a comment above it to describe the test's purpose.` --- docs/CheckList.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/CheckList.md b/docs/CheckList.md index d8934ce..3233aae 100644 --- a/docs/CheckList.md +++ b/docs/CheckList.md @@ -16,13 +16,13 @@ - [ ] 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. + - [ ] Surround top-level function and class definitions with two blank lines. + - [ ] Method definitions inside a class are surrounded by a single blank line. ### Tests -- [ ] Above each test should have a comment that describes what the test is meant for. -- [ ] If the test expect `Exception` use `pytest.rise` -- [ ] To test several invalid value test cases use `parametrize`. + - [ ] 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 \ No newline at end of file + - [ ] pipenv run python -m pytest -v + - [ ] pipenv run flake8 --max-line-length 120 \ No newline at end of file From dba83796d3fbda1e7fd8e51ceab688716ca7f8d0 Mon Sep 17 00:00:00 2001 From: yulisuliman Date: Thu, 21 Apr 2022 14:52:48 +0300 Subject: [PATCH 4/4] Add Requirements for PR to checklist --- docs/CheckList.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CheckList.md b/docs/CheckList.md index 3233aae..ef4a125 100644 --- a/docs/CheckList.md +++ b/docs/CheckList.md @@ -25,4 +25,6 @@ ## 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 \ No newline at end of file + - [ ] pipenv run flake8 --max-line-length 120 +## Requirements for PR +- [ ] Add pictures for PR that contain view change.