Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 1.85 KB

File metadata and controls

59 lines (44 loc) · 1.85 KB

Development (contributor workflow)

This page documents common contributor workflows: pre-commit, Commitizen.

Pre-commit hooks (verification tests)

Run hooks manually when needed:

Terminal (pwsh / bash):

# Run all pre-commit hooks against all files
pre-commit run --all-files
# Run all pre-commit hooks against all files, as they would run on pre-push
pre-commit run --all-files --hook-stage pre-push

Commitizen (conventional commits)

Use cz commit to create standardized commit messages. The commit-msg pre-commit hook validates the format.

Terminal (pwsh / bash):

# Run instead of git commit to create a standardized commit message
cz commit
# Alternative: Create and preview the commit message without creating a commit
cz commit --dry-run

Publish on GitHub

Since the original repository is on a self-hosted GitLab instance, to publish updates to GitHub, there are several steps necessary:

Terminal (pwsh / bash):

# 1. Create and switch to a new branch (branch name: main-github) for the release:
git checkout -b main-github
# 2. Filter the Repository using `git-filter-repo` (removing all files in 'private' folders)
git filter-repo --path-glob '*/private/*' --invert-paths --force
# 3. Add the github repository as a remote (remote name:origin-github)
git remote add origin-github https://github.com/erc-fhv/open-ev-fleet.git
# 4. Push the changes to GitHub (local: main-github to remote origin-github:main)
git push origin-github main-github:main
# 5. Switch back to the main branch
git checkout main
# 6. Delete the temporary branch
git branch -D main-github

Hint:

  • git-filter-repo is available from in the -dev dependency group managed by UV of the project, via the project's .venv.
  • To use git-filter-repo without setting up the project's .venv you can install it via uv tool install git-filter-repo.