Skip to content

Commit

Permalink
Merge branch 'master' into 284-add-translations-to-events-and-event-page
Browse files Browse the repository at this point in the history
  • Loading branch information
magsyg authored and magsyg committed Dec 18, 2023
2 parents 922338d + b8803f0 commit be79009
Show file tree
Hide file tree
Showing 109 changed files with 2,818 additions and 690 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11.0' # From file: '.python-version'
python-version: '3.11.2' # From file: '.python-version'

- name: Install dependencies
run: |
Expand Down
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"recommendations": [
"eeyore.yapf",
"ms-python.flake8",
"eamodio.gitlens",
"mikestead.dotenv",
"ms-python.python",
Expand All @@ -11,6 +13,11 @@
"ms-python.vscode-pylance",
"editorconfig.editorconfig",
"yzhang.markdown-all-in-one",
"visualstudioexptteam.vscodeintellicode",
"hediet.vscode-drawio",
"stylelint.vscode-stylelint",
"ms-python.mypy-type-checker",
"rvest.vs-code-prettier-eslint",
"visualstudioexptteam.vscodeintellicode"
]
}
2 changes: 2 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"type": "python",
"request": "attach",
"django": true,
"justMyCode": false,
"connect": {
"host": "0.0.0.0",
"port": 5678
Expand All @@ -28,6 +29,7 @@
"name": "Django (localhost)",
"type": "python",
"request": "attach",
"justMyCode": false,
"django": true,
"connect": {
"host": "0.0.0.0",
Expand Down
83 changes: 80 additions & 3 deletions .vscode/settings.default.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,85 @@
{
// These settings are required for the project.

// ================================
// Editor
// ================================
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"html.format.enable": false,
"python.linting.enabled": true,

// ================================
// Backend
// ================================
// yapf (formatter)
"yapf.importStrategy": "fromEnvironment",
"yapf.args": ["--style", "backend/.style.yapf"],
// mypy (type checker, linter)
"mypy-type-checker.importStrategy": "fromEnvironment",
"mypy-type-checker.args": ["--config-file", "backend/mypy.ini", "--no-pretty"],
// flake8 (linter)
"flake8.importStrategy": "fromEnvironment",
"flake8.args": ["--config", "backend/.flake8"],
// pytest
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["-c", "backend/pytest.ini"],
"python.formatting.provider": "yapf"
// Other
"python.envFile": "backend/.env",
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.organizeImports": false
},
"editor.defaultFormatter": "eeyore.yapf"
},

// ================================
// Frontend
// ================================
"eslint.enable": true,
"eslint.format.enable": true,
"html.format.enable": false,
"prettier.configPath": "frontend/.prettierrc.js",
"prettier.ignorePath": "frontend/.prettierignore",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.workingDirectories": ["frontend"],
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.organizeImports": true
}
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"[scss]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
},
"[css]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
},
"css.validate": true,
"less.validate": true,
"scss.validate": true,
"stylelint.configFile": "frontend/.stylelintrc",
"stylelint.enable": true,
"stylelint.validate": ["css", "scss"]
}
72 changes: 50 additions & 22 deletions .vscode/settings.emil.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,56 @@
{
"files.autoSave": "onFocusChange",
// ================================
// Editor
// ================================
"editor.formatOnSave": true,
"eslint.workingDirectories": ["frontend"],
"python.linting.mypyEnabled": true,
"python.linting.mypyArgs": ["--config-file", "backend/mypy.ini", "--no-pretty"],
"files.autoSave": "onFocusChange",
"diffEditor.codeLens": true,
"window.title": "🟥 ${activeEditorShort}${separator}${rootName}",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--config", "backend/.flake8"],
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["-c", "backend/pytest.ini"],
"python.formatting.provider": "yapf",
"python.envFile": "backend/.env",
"workbench.colorCustomizations": {
"titleBar.activeForeground": "#fff",
"titleBar.activeBackground": "#a03033",
"titleBar.inactiveBackground": "#a03033",
"editorCursor.foreground": "#ff2222"
},
"python.testing.unittestEnabled": false,
"workbench.iconTheme": "atom-icons",
"workbench.colorTheme": "Atom One Dark",
"workbench.tree.indent": 20,

// ================================
// Backend
// ================================
// yapf (formatter)
"yapf.importStrategy": "fromEnvironment",
"yapf.args": ["--style", "backend/.style.yapf"],
// mypy (type checker, linter)
"mypy-type-checker.importStrategy": "fromEnvironment",
"mypy-type-checker.args": ["--config-file", "backend/mypy.ini", "--no-pretty"],
// flake8 (linter)
"flake8.importStrategy": "fromEnvironment",
"flake8.args": ["--config", "backend/.flake8"],
// pytest
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["-c", "backend/pytest.ini"],
// Other
"python.envFile": "backend/.env",
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.organizeImports": false
},
"editor.defaultFormatter": "eeyore.yapf"
},

// ================================
// Frontend
// ================================
"eslint.enable": true,
"eslint.format.enable": true,
"diffEditor.codeLens": true,
"html.format.enable": false,
"prettier.configPath": "frontend/.prettierrc.js",
"prettier.ignorePath": "frontend/.prettierignore",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.workingDirectories": ["frontend"],
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
Expand All @@ -34,7 +61,7 @@
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll": false,
"source.organizeImports": true
}
},
Expand All @@ -52,20 +79,21 @@
"source.organizeImports": true
}
},
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.organizeImports": false
}
"[scss]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
},
"[css]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
},
// "[scss]": {
// "editor.defaultFormatter": "stylelint.vscode-stylelint"
// },
"css.validate": true,
"less.validate": true,
"scss.validate": true,
"stylelint.configFile": "frontend/.stylelintrc",
"stylelint.enable": true,
"stylelint.validate": ["css", "scss"],

// ================================
// Other
// ================================
"svg.preview.background": "editor"
}
51 changes: 14 additions & 37 deletions .vscode/settings.suggestions.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,21 @@
{
"editor.formatOnSave": true,
// Hide import regions automatically, e.g. (.js)
// These settings are not required for the project.

// Hide import regions automatically, e.g. (.js).
"editor.foldingImportsByDefault": true,

// Automatically set filetype when opening a new file.
// This setting determines new filetype based on the current focused file.
"files.defaultLanguage": "${activeEditorLanguage}",
// Change layout of the upper title

// Change layout of the upper title.
"window.title": "🦐 ${activeEditorShort}${separator}${rootName}",
"[typescript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"[typescriptreact]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"[javascriptreact]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"[javascript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.organizeImports": false
}

// Change layout of editor.
"workbench.colorCustomizations": {
"titleBar.activeForeground": "#fff",
"titleBar.activeBackground": "#a03033",
"titleBar.inactiveBackground": "#a03033",
"editorCursor.foreground": "#ff2222"
}
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Useful Commands](/docs/useful-commands.md)
- [Technologies used on Samf4 🤖](/docs/technical/Samf4Tech.md)
- [Useful Docker aliases](/docs/docker-project-specific-commands.md)

## Installation

We have a script that handles all installation for you. To run the script, a Github Personal Access Token (PAT) is required.
Expand Down
7 changes: 5 additions & 2 deletions backend/.docker.example.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ ENV=development
ENABLE_DEBUGPY=yes

# Automatically create local superuser
DJANGO_SUPERUSER_USERNAME=emilte
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_PASSWORD=Django123
DJANGO_SUPERUSER_EMAIL=emil97@live.no
DJANGO_SUPERUSER_EMAIL=mg-web@samfundet.no

DOMAIN=0.0.0.0

Expand All @@ -35,3 +35,6 @@ DB_PORT=5432
EMAIL_HOST=smtp.gmail.com
EMAIL_HOST_USER= example@gmail.com
EMAIL_HOST_PASSWORD=...

# Github webhook secret.
WEBHOOK_SECRET=...
3 changes: 3 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ DB_PORT=5432
EMAIL_HOST=smtp.gmail.com
EMAIL_HOST_USER=your_email@gmail.com
EMAIL_HOST_PASSWORD=your_email_password

# Github webhook secret.
WEBHOOK_SECRET=...
Loading

0 comments on commit be79009

Please sign in to comment.