-
Notifications
You must be signed in to change notification settings - Fork 36
Development Guidelines
Steve Hillier edited this page Apr 6, 2018
·
6 revisions
To ensure that future additions to the code base are continuously improving the overall code quality, please follow these guidelines:
- Follow PEP-8 Style Guide for basic guidelines on style and organization.
- Use 4 spaces instead of tabs for indents
- Enable PEP-8 linting in your IDE.
- For VSCode: Linting Python in Visual Studio Code
- PEP-8 suggests a 79 character line limit, but that is not always practical. Please wrap long lines before 110 characters (approximate limit for viewing changes on GitHub).
- Follow conventions in Django's official documentation or Two Scoops of Django 1.11 (a copy available in lab)
-
Model ForeignKey relationship: on_delete - in general, use
models.PROTECT
.
- Tests: to run Django tests, use
python manage.py test -c nose.cfg
. When submitting any new code or features, please include unit tests in your pull request.
-
npm install
will install ESLint with the "Standard" style guide set of linting rules. We use "Standard" because Vue documentation tends to use this style.
- Run tests with
npm run test
ornpm run watch
(auto-watch files and run tests on files that you change) - Vue unit tests use Jest and vue-test-utils. Refer to the current tests or the documentation for each for guidance on writing more.
- The general workflow for writing a test is to shallow render a component (render one component and its immediate child components only), then search for the tag or id's in the HTML (
wrapper.find("p")
) or inspect the Vue instance data (wrapper.vm.myVariable
).
- Working on GWELLS (full workflow from writing code to deploying to prod)
- Water terminologies
- Testing
- Swagger Documentation
- Restore a database backup manually
- (Archived) Manual Syncing of DEV to TEST to PROD
- (Archived) Setup GWells data migration for local dev test
- Update PostGres Oracle Foreign Data Wrapper image
- Increase PostgreSQL Database storage
- (Archived) Regular Corruption of the PostgreSQL DB
- (Archived) Recovering from a corrupt PostgreSQL Database