Skip to content

issaloo/standard-code-quality-workflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Standard Code Quality Workflow (Python)

Contributing

General Guidelines

Please take a look at the following guides on writing code:

Set Up Development Environment

  1. Clone and navigate to the repository
cd ~/GitHub/issaloo
git clone git@github.com:issaloo/standard-code-quality-workflow.git
cd standard-code-quality-workflow
  1. Install pdm globally
pip install pdm
  1. Install general & development packages with pdm
pdm install --dev

ℹ️ This will install packages pre-commit, commitizen, and gitlint

(Optional) Install only the general packages

pdm install
  1. Activate the virtual environment
eval $(pdm venv activate)

ℹ️ Virtual environment will use the same python version as the system

(Optional) Deactivate the virtual environment

deactivate

Set Up Standardized Version Control

  1. Automate scripts (i.e., linting and autoformatting)

    pre-commit install
  2. Enforce template at commit with pre-commit

    gitlint install-hook

Test It Out

  1. Check if commitizen is working

    • 🔎 Try using commitizen in command line
      1. Add files to staging
      2. Run commitizen
        git cz c
        Or, if possible
        cz c
    • ✅ You should get structured commits
  2. Check if gitlint is working

    • 🔎 Try writing a bad commit
      1. Add files to staging
      2. Write a bad commit (e.g., git commit -m 'WIP: baD commit')
    • ✅ You should get a question on whether to continue the commit.
  3. Check if pre-commit is working

    • 🔎
      1. Add files to staging, where at least one python file is not formatted well
      2. Run commitizen
        git cz c
        Or, if possible
        cz c
    • ✅ You should get automatic fixes to poorly formatted python files with some errors

    ℹ️ Ctrl+C to exit commit template

About

Current standardized code quality workflow for Python with example file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages