Ensure that you have docker and docker-compose installed on your machine, as well as the rest of the Python stack.
- GitBash
- Python 3.6.7
- https://www.python.org/downloads/release/python-367/ - Windows x86-64 executable installer
- “Install now”
- Bypass character count limit option
- You should be able to open a Python 3.6 Desktop App and run lines of Python
- PiP
- Download get-pip.py
- Go to https://bootstrap.pypa.io/
- Right click on 'get-pip.py' -> 'Save link as...'
- Select a download location
- Navigate to the file in a terminal, run 'python get-pip.py'
- Add pip's directory to the path system environment variable (usually "\Scripts")
- Pip is used to build the backend so that snyk can anaylze it locally
- Download get-pip.py
- Docker
- Docker Compose
- Visual Studios Code
- Install
- Download VS Code for Windows
- Download location is default: C:\Users\cbrock\AppData\Local\Programs\Microsoft VS Code
- Check “Create a desktop icon”
- Click “Install”
- Customize Tools and Languages - install language specific packages
- Python by Microsoft
- Docker by Microsoft
- Django by Baptiste Darthenay
- PostgreSQL by Chris Kolkman
- React Redux ES6 Snippets by Timothy McLane
- ESLint by Dirk Baeumer
- Prettier - Code formatter by Esben Petersen
- Git History Diff by Hui Zhou
- Linting Configuration
- Pylint:
- Open '.\project-thundercat.vscode\settings.json' file
- Search for 'python.linting.pylintEnabled' and make sure it is set to 'true' (User and Workspace settings)
- Now, you can edit the desired settings from .pylintrc file (to disable messages, see line 54 of the config file)
- Click here for more details on most of the Pylint errors/warnings
- ESLint:
- Open '.\project-thundercat.vscode\settings.json' file
- Search for 'eslint.enable' and make sure it is set to 'true' (User and Workspace settings)
- Insert "editor.formatOnSave": true into your User Settings in VSCode.
- Select 'USER SETTINGS' tab in the right hand side window of the settings file
- Add the following parameter: "eslint.options": {"configFile": "<path_of_your_project_root>\\frontend\\.eslintrc.json"}
- ESLint is now installed and configured
- If ESLint is not working, do the following steps:
- Close Docker: Right Click on Docker icon + Quit Docker
- Navigate in your Windows explorer and delete the folder called 'node_modules' under '.\\project-thundercat\\frontend'
- Start Docker
- Open a powershell window and do a 'docker-compose up'
- Wait a couple minutes to make sure that all packages have been downloaded
- Restart VS Code
- If ESLint is not working, do the following steps:
- You can also add/edit/remove rules from .prettierrc.json file
- Click here for more details about ESLint or here to know more about the Airbnb React style
- Pylint:
- Install
-
Snyk
- Run 'npm install -g snyk' in a terminal
- Run 'npm install -g snyk-to-html' in a terminal
- This allows for clean output to html files when snyk is run locally
- Locally detected vulnerabilities can be documented in the repo and version controlled
- See snyk.md for an explanation of why snyk is installed locally rather than in the containers
- Add the npm directory containing snyk to the path system environment variable (usually "C:\Users<name>\AppData\Roaming\npm")
- Note: You may need to restart your computer for this change to take effect
- Create an account on snyk.io
- Run 'snyk auth' in a terminal
- Login when prompted (either in using the provided URL or in the opened browser)
-
Accessibility Check Tool (pa11y)
- Run 'run 'npm install -g pa11y' in a terminal
- Run also 'npm install -g pa11y pa11y-reporter-html' in a terminal
- This allows for clean output to html file when this tool is run locally
- It detects errors, warnings and notices related to accessibility of the application
- Make sure that the npm directory containing pa11y is part of the path system environment variable (usually "C:\Users<name>\AppData\Roaming\npm")
- Should have already been added during Snyk configuration (see above)
- Click here to have more details about pa11y.