https://github.com/default-writer/python-decorators
https://github.com/default-writer/python-decorators
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/default-writer/python-decorators
- Owner: default-writer
- License: mit
- Created: 2021-12-09T20:36:35.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-11T06:32:57.000Z (over 4 years ago)
- Last Synced: 2025-04-20T20:33:43.763Z (about 1 year ago)
- Language: Dockerfile
- Size: 134 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Visual Studio Code Playground
Python Decorators
Default template for working with Python Decorators from Visual Studio Code
# Project structure
- ./bin
- build_requirements.txt - file with build prerequisites
- build.sh - utility for buiding environment. uses ./env.sh internally
- env.sh - utility for the first run. writes to ./env
- format.sh - utility for reformatting source code using pre-commit
- lint.sh - utility for finding code issues. writes to ./pylint
- test.sh - utility for running tests and code coverage. writes to ./pytest, ./coverage
- update.sh
# Recommendations
- clone repository in container volume
- apply chmod +x for ./bin utilities
- setup environment using ./bin/env.sh utility
- update environment using ./bin/update.sh utility
- update requirements.txt if needed
```bash
chmod +x ./bin/build.sh
chmod +x ./bin/format.sh
chmod +x ./bin/lint.sh
chmod +x ./bin/test.sh
chmod +x ./bin/update.sh
```
To add pre-commit git pre-commit hook on tests, add hook and change it to executable
```bash
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
```
```bash
#!/bin/sh
set -e
cd "${0%/*}"
status=$?
../../bin/test.sh
status=$?
[ $status -eq 0 ] && echo "SUCCESS" || exit 1
```