-
Notifications
You must be signed in to change notification settings - Fork 167
Development Tips
- run
manage.py runto start the django development server - Before opening a pull request, running these could be helpful (otherwise, our CI will fail)
- run
manage.py testto run the test suite - run
manage.py lintto run the linter - run
manage.py formatto run the code formatter
- run
- run
manage.py migratewhenever you pull changes with new migrations - run
manage.py makemigrationswhenever you change any models - run
manage.py reload_testdatato throw away the database and reload the test_data - run
manage.py scss --watchif you want to compile your stylesheets automatically. (otherwise this happens only once onmanage.py run) - run
manage.py shellto interactively test python code (or tryshell_pluswhich has some more fanciness) - use
manage.py dump_testdatafor creating a new test_data.json - run
manage.py translateas a shortcut formakemessagesfor the required German translation with appropriate arguments
We have a list of commits that clutter git blame history in .git-blame-ignore-revs. You can pass --ignore-revs-file .git-blame-ignore-revs to git in order to ignore these commits. You probably want to set up your git to automatically do this, using:
git config blame.ignoreRevsFile .git-blame-ignore-revsIt probably makes sense to integrate our linter, pylint, and our code formatter, black, into your IDE. You can also set up precommit hooks to automatically run these when committing.
Use poedit to edit the translation files
To automatically activate the nix develop environment when entering the EvaP directory, you can install direnv and nix-direnv.
Afterwards, create the file .envrc with the following contents:
use flake
We also provide a evap-dev-with-lsp dev shell where additionally LSP packages are available (helpful in vim/neovim/vscode). For bisecting or other use cases where you jump between git commits frequently, you can "pin" the environment specification to always use the "official" main branch state, independently of your local commit.
use flake github:e-valuation/evap/#evap-dev-with-lsp
To install additional packages in the nix develop environment, use the extraPackages and extraPythonPackages arguments when importing shell.nix in flake.nix.
Find the packages you are looking for at https://search.nixos.org/packages.
Make sure to not include these changes in your git commits.
You can use git update-index --assume-unchanged, if you know what you are doing.