Skip to content

Windows manual testing

Joris Roovers edited this page Nov 14, 2022 · 10 revisions

Machine prep

If you're on a cloud instance, make sure you have the latest code and are on the main branch.

# Remove any previous installations
rd /s /q gitlint
git clone https://github.com/jorisroovers/gitlint.git
cd gitlint-core
python setup.py develop
cd .. # main gitlint dir
pip install -r requirements.txt
# Optional
pip install -r test-requirements.txt

General

# No quotes for echo on windows
echo WIP: test | gitlint
echo WIP: test | gitlint --ignore T2
echo WIP: test | gitlint -c general.ignore=B6,T5 
echo WIP: test | gitlint --ignore-stdin --debug

# User-defined, Contrib Rules
echo WIP: test | gitlint -e examples/ --debug
echo WIP: test | gitlint --contrib CC1 --debug

# Doesn't seem to print correctly
echo WIP: tëst | gitlint

# Seems to work
gitlint --debug --commit 3ee281


# Env variables (works)
Set GITLINT_DEBUG=True
gitlint

# Print author name (contains unicodes): gives problems
git log -1 --pretty=%an  "3ee281^..3ee281" | gitlint --debug

# Add file, stage changes, see if gitlint picks the changed file up in debug output
echo foo > foo.txt
git add foo.txt
git status
echo foobar | gitlint --debug --staged

# Generate config (delete previous, generate new, output file)
del .gitlint
gitlint generate-config
type .gitlint

Commit-msg hook

# Inside gitlint dir
tools\windows\create-test-repo.bat
cd <dir>
gitlint install-hook
git commit --amend

Git-bash

Repeat all above steps, but set export GITLINT_IGNORE_STDIN=1 to work around #91