Skip to content

Commit 1fd5c61

Browse files
committed
cookiecutter help text + .eslintrc update
1 parent ce3d9f6 commit 1fd5c61

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

cookiecutter.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
2-
"_0": "\n\t Welcome in the django generation project!\n",
2+
"_0": "\n\t Some information before the generation!\n",
33
"_1": "\n\t project_name: The name of the project.",
44
"_2": "\n\t repo_name: The directory name(automtically generated from the project_name).",
55
"_3": "\n\t db_password: The postgres user password for the database.",
6-
"_4": "\n\t use_translation: Translation integration(Rosetta, ModelTransalation, admin integration).",
7-
"_5": "\n\t use_react: React, NodeJS, React-Router to replace the django frontend.",
6+
"_4": "\n\t use_translation: Translation integration(Rosetta, ModelTransalation, admin integration)[True/False].",
7+
"_5": "\n\t use_react: React, NodeJS, React-Router to replace the django frontend.[True/False]",
88
"_6": "\n\t admin_name: The name of the admin user who will receive the error messages.",
99
"_7": "\n\t admin_email: The email address of the admin user who will receive the error messages.",
1010
"_8": "\n\t email_host_user: The gmail email address what the system can use to send emails.",
1111
"_9": "\n\t email_host_password: The gmail email address password what the system can use to send emails.\n",
12-
"*": "{{cookiecutter._0 + cookiecutter._1 + cookiecutter._2 + cookiecutter._3 + cookiecutter._4 + cookiecutter._5 + cookiecutter._6 + cookiecutter._7 + cookiecutter._8 + cookiecutter._9}}",
12+
"_10": "\n\t Press ENTER to continue.\n",
13+
"*": "{{cookiecutter._0 + cookiecutter._1 + cookiecutter._2 + cookiecutter._3 + cookiecutter._4 + cookiecutter._5 + cookiecutter._6 + cookiecutter._7 + cookiecutter._8 + cookiecutter._9 + cookiecutter._10}}",
1314
"project_name": "project_name",
1415
"repo_name": "{{cookiecutter.project_name|replace(' ', '_')}}",
1516
"db_password": "db_password",

hooks/post_gen_project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Core and 3th party packages
33
import os
44
from random import SystemRandom
5+
import shutil
56

67

78
def generate_secret_key():
@@ -37,14 +38,13 @@ def make_secret_key(project_directory):
3738

3839
{% if cookiecutter.use_translation != 'True' -%}
3940
# Remove the empty directory if we don't want to use rosetta
40-
import shutil
4141
shutil.rmtree(PROJECT_DIR + '/src/core/management/')
4242
{%- endif %}
4343

4444
{% if cookiecutter.use_react != 'True' -%}
4545
# Remove the nodejs/rect files & directories
46-
import shutil
4746
shutil.rmtree(PROJECT_DIR + '/react/')
4847
shutil.rmtree(PROJECT_DIR + '/docker/nodejs/')
4948
shutil.rmtree(PROJECT_DIR + '/src/core/static/react/')
49+
os.remove(PROJECT_DIR + '/.eslintrc')
5050
{%- endif %}

{{cookiecutter.repo_name}}/.eslintrc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
"no-caller": 2, // disallow use of arguments.caller or arguments.callee
6161
"no-div-regex": 2, // disallow division operators explicitly at beginning of regular expression (off by default)
6262
"no-else-return": 2, // disallow else after a return in an if (off by default)
63-
"no-empty-label": 2, // disallow use of labels for anything other then loops and switches
6463
"no-eq-null": 2, // disallow comparisons to null without a type-checking operator (off by default)
6564
"no-eval": 2, // disallow use of eval()
6665
"no-extend-native": 2, // disallow adding to native types
@@ -85,7 +84,7 @@
8584
"no-proto": 2, // disallow usage of __proto__ property
8685
"no-redeclare": 2, // disallow declaring the same variable more then once
8786
"no-return-assign": 2, // disallow use of assignment in return statement
88-
"no-script-url": 2, // disallow use of javascript: urls.
87+
"no-script-url": 0, // disallow use of javascript: urls.
8988
"no-self-compare": 2, // disallow comparisons where both sides are exactly the same (off by default)
9089
"no-sequences": 2, // disallow use of comma operator
9190
"no-throw-literal": 2, // restrict what can be thrown as an exception (off by default)
@@ -125,7 +124,6 @@
125124
"eol-last": 1, // enforce newline at the end of file, with no multiple empty lines
126125
"func-names": 0, // require function expressions to have a name (off by default)
127126
"func-style": 0, // enforces use of function declarations or expressions (off by default)
128-
"key-spacing": [1, {"beforeColon": false, "afterColon": true}], // enforces spacing between keys and values in object literal properties
129127
"max-nested-callbacks": [1, 3], // specify the maximum depth callbacks can be nested (off by default)
130128
"new-cap": [1, {"newIsCap": true, "capIsNew": false}], // require a capital letter for constructors
131129
"new-parens": 1, // disallow the omission of parentheses when invoking a constructor with no arguments
@@ -149,12 +147,21 @@
149147
"semi": [1, "always"], // require or disallow use of semicolons instead of ASI
150148
"semi-spacing": [1, {"before": false, "after": true}], // enforce spacing before and after semicolons
151149
"sort-vars": 0, // sort variables within the same declaration block (off by default)
152-
"space-after-keywords": [1, "always"], // require a space after certain keywords (off by default)
150+
"key-spacing": [2, {
151+
"singleLine": {
152+
"beforeColon": false,
153+
"afterColon": true
154+
},
155+
"multiLine": {
156+
"beforeColon": false,
157+
"afterColon": true,
158+
"align": "colon"
159+
}
160+
}],
153161
"space-before-blocks": [1, "always"], // require or disallow space before blocks (off by default)
154162
"space-before-function-paren": [1, {"anonymous": "always", "named": "never"}], // require or disallow space before function opening parenthesis (off by default)
155163
"space-in-parens": [1, "never"], // require or disallow spaces inside parentheses (off by default)
156164
"space-infix-ops": 1, // require spaces around operators
157-
"space-return-throw-case": 1, // require a space after return, throw, and case
158165
"space-unary-ops": [1, {"words": true, "nonwords": false}], // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
159166
"spaced-comment": [1, "always"], // require or disallow a space immediately following the // in a line comment (off by default)
160167
"wrap-regex": 0, // require regex literals to be wrapped in parentheses (off by default)

0 commit comments

Comments
 (0)