diff --git a/python/README.md b/python/README.md index 817c39e..83a0a33 100644 --- a/python/README.md +++ b/python/README.md @@ -378,9 +378,6 @@ In Python, single-quoted strings and double-quoted strings are the same. This PE For triple-quoted strings, always use double quote characters to be consistent with the docstring convention in [PEP 257](https://www.python.org/dev/peps/pep-0257). -Here at Rootstrap we prefer to use single-quoted strings over double quotes. -For docstrings we use double quotes since the chance of writing a ' is higher in the documentation string of a class or a method - ## Whitespace in Expressions and Statements ### Pet Peeves diff --git a/python/cookiecutter-django.md b/python/cookiecutter-django.md index cf9a7fb..0439ba2 100644 --- a/python/cookiecutter-django.md +++ b/python/cookiecutter-django.md @@ -225,22 +225,6 @@ exclude = '.*\/(migrations|settings)\/.*' - This command list all the issues found. - A useful command could be `$ black .` which resolves all the issues. Also, you can run `$ black . --diff` to watch the proposed changes. -### If you want to have this in a new Github repository -If you want to have this project in a new Github repository under the rootstrap organization, then follow these steps: -1. Go to Github. -2. Click on create new repository. -3. Under Owner, select rootstrap. -4. Write the name for the respository equal to the name of the root folder of the project created with DjangoCookieCutter. -5. Copy the `git clone with ssh value` from the project. -6. Go to the root folder project in your terminal. -7. Run `$ git init` -8. Run `$ git remote add origin ` -9. If your current branch hasn't the `main` branch, then run `$ git checkout -b main` -10. Run `$ git add .` -11. Run `$ git commit -m "First commit"`. You can change the `"First commit"` message with whatever you think is correct. -12. Run `$ git push origin main` -13. If you had to run `$ git checkout -b main` then now run `$ git branch -M main` - ### [pre-commit](https://pre-commit.com/) *NOTE: By default this package is already installed.* @@ -275,32 +259,81 @@ If you add Mypy to pre-commit it will check the typing in the files you change o ... ``` -You may need more configuration in `additional_dependencies` depending on your project libraries because these pre-commit stages are running in an independent environment. - - If you want to check the Github Wokflow configuration please take a look at this [section](#github-workflow) -A useful command could be `$ mypy .`, which shows you all the typing issues you have in all your Python files. +A useful command could be `$ mypy .`, which shows you all the typing issues you have in all your Python files. -### Single-quotes -> *Here at Rootstrap we prefer to use single-quoted strings over double quotes. For docstrings we use double quotes since the chance of writing a ' is higher in the documentation string of a class or a method.* -> -> [Rootstrap Guides/Python/String Quotes](https://github.com/rootstrap/tech-guides/tree/master/python#string-quotes) +### exclude in mypy +You may need to exclude files in mypy (for example configurations and migrations files). You can get this done +adding a regexp list called `exclude` in the `setup.cfg` file. This is an example: -To convert the existing double quotes to single ones, follow these steps: -1. In your IDE, search by the regex `/(?` +9. If your current branch hasn't the `main` branch, then run `$ git checkout -b main` +10. Run `$ git add .` +11. Run `$ git commit -m "First commit"`. You can change the `"First commit"` message with whatever you think is correct. +12. Run `$ git push origin main` +13. If you had to run `$ git checkout -b main` then now run `$ git branch -M main` ## CI