Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

857 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI codecov CodeQL Code style: black GitHub language count

My Linux / Mac environment

Installation

Configure precommit as described in this blogpost: https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/ Commands:

  1. Install precommit: pip install pre-commit
  2. Make sure to add pre-commit to your path. For example, on a Mac system, pre-commit is installed here: $HOME/Library/Python/3.8/bin/pre-commit.
  3. Execute pre-commit install to install git hooks in your .git/ directory.

Testing

Python tests use Poetry 2.x and pytest. Shell tests live under tests/.

Prerequisites

  • Python 3.9 or newer
  • Poetry 2.x (pip install "poetry>=2.0,<3.0")

Install dependencies

From the repo root:

poetry install --only main,dev

This installs runtime and dev dependencies. The optional localdev group (sibling repos such as python-commons) is not required for tests.

Run Python tests

poetry run python -m pytest

Pytest is configured in pyproject.toml to collect tests from scripts/git and scripts/disk_cleanup.

With coverage (same as CI):

mkdir -p junit
poetry run python -m pytest \
  --junitxml=junit/test-results.xml \
  --cov=scripts/git \
  --cov=scripts/disk_cleanup \
  --cov-report=xml \
  --cov-report=html

Coverage HTML is written to htmlcov/. JUnit XML goes to junit/test-results.xml.

Run shell tests

find tests -type f \( -name "*.sh" -o -name "*.zsh" \) -exec chmod +x {} \;
find tests -type f \( -name "*.sh" -o -name "*.zsh" \) -print0 | while IFS= read -r -d '' script; do
  echo "Running $script..."
  "$script"
done

On Ubuntu/Debian, install zsh first if needed (sudo apt-get install -y zsh).

Disk cleanup

See scripts/disk_cleanup/README.md for usage of cleanup_disk.py.

Git: moving large files out of a repo

See scripts/git/git-workflow-for-moving-large-files.md for offloading large archives from a git working tree or specific commits via git_move_large_files.py. Run it with poetry run python scripts/git/git_move_large_files.py ... from this repo so dependencies are available.

Claude session exporter

The export_claude_sessions.py script (and its session_rename_report.py companion) has been extracted to its own repository:

Full history was preserved via git-filter-repo. Clone it under ~/development/my-repos/claude-session-exporter/ and point your claude-export alias there.

Troubleshooting

pre-commit installation

In case you're facing a similar issue:

An error has occurred: InvalidManifestError: 
=====> /<userhome>/.cache/pre-commit/repoBP08UH/.pre-commit-hooks.yaml does not exist
Check the log at /<userhome>/.cache/pre-commit/pre-commit.log

, please run: pre-commit autoupdate More info here: pre-commit/pre-commit#577

About

My Linux and Mac environment, features auto-loading changes from the repository into the shell environment and other useful goodies.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages