diff --git a/.github/workflows/lint-infra.yml b/.github/workflows/lint-infra.yml deleted file mode 100644 index 5fc9b8f..0000000 --- a/.github/workflows/lint-infra.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: lint-infra - -on: - push: - pull_request: - -jobs: - shellcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - with: - persist-credentials: false - - - name: Run shellcheck - run: | - find . -name "*.sh" \ - -not -path "./hashcat-utils/*" \ - -not -path "./princeprocessor/*" \ - -not -path "./omen/*" \ - -not -path "./PACK/*" \ - -not -path "./build/*" \ - -not -path "./dist/*" \ - -not -path "./.venv/*" \ - -print0 | xargs -0 shellcheck - - actionlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - with: - persist-credentials: false - - - name: Install actionlint - run: | - curl -sL https://github.com/rhysd/actionlint/releases/download/v1.7.11/actionlint_1.7.11_linux_amd64.tar.gz | tar xz - sudo mv actionlint /usr/local/bin/ - - - name: Run actionlint - run: actionlint diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml deleted file mode 100644 index 6a1fd23..0000000 --- a/.github/workflows/pytest.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: pytest - -on: - push: - pull_request: - -jobs: - pytest: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - with: - persist-credentials: false - - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install system dependencies - run: sudo apt-get update && sudo apt-get install -y p7zip-full transmission-cli - - - name: Install uv - run: python -m pip install --upgrade pip uv==0.9.28 - - - name: Install project dependencies - run: | - uv venv .venv - uv pip install --python .venv/bin/python ".[dev]" - - - name: Run tests - env: - HATE_CRACK_RUN_E2E: "0" - HATE_CRACK_RUN_DOCKER_TESTS: "0" - HATE_CRACK_RUN_LIVE_TESTS: "0" - HATE_CRACK_SKIP_INIT: "1" - run: .venv/bin/python -m pytest diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml deleted file mode 100644 index 4720358..0000000 --- a/.github/workflows/ruff.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: ruff - -on: - push: - pull_request: - -jobs: - ruff: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - with: - persist-credentials: false - - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 - with: - python-version: "3.13" - - - name: Install uv - run: python -m pip install --upgrade pip uv==0.9.28 - - - name: Install dev dependencies - run: | - uv venv .venv - uv pip install --python .venv/bin/python ".[dev]" - - - name: Run ruff - run: .venv/bin/ruff check hate_crack diff --git a/.github/workflows/ty.yml b/.github/workflows/ty.yml deleted file mode 100644 index 7322bc6..0000000 --- a/.github/workflows/ty.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: ty - -on: - push: - pull_request: - -jobs: - ty: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - with: - persist-credentials: false - - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 - with: - python-version: "3.13" - - - name: Install uv - run: python -m pip install --upgrade pip uv==0.9.28 - - - name: Install dev dependencies - run: | - uv venv .venv - uv pip install --python .venv/bin/python ".[dev]" - - - name: Run ty - run: .venv/bin/ty check hate_crack diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml deleted file mode 100644 index b2fd0b3..0000000 --- a/.github/workflows/version-bump.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: version-bump - -on: - pull_request: - types: [closed] - branches: [main] - -permissions: - contents: write - -jobs: - bump: - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - with: - fetch-depth: 0 - - - name: Determine version bump type - id: bump-type - env: - BRANCH: ${{ github.head_ref }} - TITLE: ${{ github.event.pull_request.title }} - run: | - # Feature branches (feat/) bump minor, everything else bumps patch - if echo "$BRANCH" | grep -qiE '^feat/'; then - echo "type=minor" >> "$GITHUB_OUTPUT" - elif echo "$TITLE" | grep -qiE '^feat'; then - echo "type=minor" >> "$GITHUB_OUTPUT" - else - echo "type=patch" >> "$GITHUB_OUTPUT" - fi - echo "Bump type: $(grep type "$GITHUB_OUTPUT" | cut -d= -f2) (branch: $BRANCH)" - - - name: Bump version - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - BUMP_TYPE="${{ steps.bump-type.outputs.type }}" - latest=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+' | head -1) - if [ -z "$latest" ]; then - echo "No version tag found, starting at v0.0.1" - next="v0.0.1" - else - version="${latest#v}" - major=$(echo "$version" | cut -d. -f1) - minor=$(echo "$version" | cut -d. -f2) - patch=$(echo "$version" | cut -d. -f3) - patch=${patch:-0} - - if [ "$BUMP_TYPE" = "minor" ]; then - next="v${major}.$((minor + 1)).0" - else - next="v${major}.${minor}.$((patch + 1))" - fi - fi - - echo "Tagging $next (previous: ${latest:-none}, bump: $BUMP_TYPE)" - git tag -a "$next" -m "Release $next" - git push origin "$next" - - - name: Create GitHub Release - env: - GH_TOKEN: ${{ github.token }} - run: | - latest=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+' | head -1) - gh release create "$latest" --title "$latest" --notes "Release $latest" --latest diff --git a/CLAUDE.md b/CLAUDE.md index 839276e..be6eded 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -35,7 +35,7 @@ uv run ruff format hate_crack make coverage ``` -**Test environment variables**: `HATE_CRACK_SKIP_INIT=1` skips binary/config validation (essential for CI and worktrees). `HASHMOB_TEST_REAL=1`, `HASHVIEW_TEST_REAL=1`, `WEAKPASS_TEST_REAL=1` enable live API tests. +**Test environment variables**: `HATE_CRACK_SKIP_INIT=1` skips binary/config validation (essential for worktrees without hashcat-utils). `HASHMOB_TEST_REAL=1`, `HASHVIEW_TEST_REAL=1`, `WEAKPASS_TEST_REAL=1` enable live API tests. ## Git Hooks @@ -165,5 +165,4 @@ Binaries are verified at startup via `ensure_binary(path, build_dir, name)`. Non - Menu option tests in `test_ui_menu_options.py` use monkeypatching against `CLI_MODULE` (loaded from `hate_crack.py`) - API tests mock `requests` responses; most are offline-first - conftest.py provides `hc_module` fixture via `load_hate_crack_module()` which dynamically imports root `hate_crack.py` with SKIP_INIT enabled -- Python 3.9-3.14 supported in CI (requires-python >=3.13 in pyproject.toml but CI tests older versions) - E2E tests (`test_e2e_local_install.py`, `test_docker_script_install.py`) are opt-in via `HATE_CRACK_RUN_E2E=1` and `HATE_CRACK_RUN_DOCKER_TESTS=1` diff --git a/README.md b/README.md index 88872c8..bcc0f31 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,6 @@ \/ \/ \/_____/ \/ \/ \/ \/ ``` -## Status - -**Code Quality & Testing:** - -[![ruff](https://github.com/trustedsec/hate_crack/actions/workflows/ruff.yml/badge.svg)](https://github.com/trustedsec/hate_crack/actions/workflows/ruff.yml) -[![ty](https://github.com/trustedsec/hate_crack/actions/workflows/ty.yml/badge.svg)](https://github.com/trustedsec/hate_crack/actions/workflows/ty.yml) -[![pytest](https://github.com/trustedsec/hate_crack/actions/workflows/pytest.yml/badge.svg)](https://github.com/trustedsec/hate_crack/actions/workflows/pytest.yml) - -The pytest workflow tests across Python 3.9-3.14 via a matrix build. - ## Installation ### 1. Install hashcat (Optional) @@ -267,33 +257,6 @@ Install the project with optional dev dependencies (includes linters and testing make dev-install ``` -### Continuous Integration - -The project uses GitHub Actions to automatically run quality checks on every push and pull request. - -**Checks that run on each commit:** - -1. **Linting (Ruff)** - Code style and quality validation - - ✅ **PASS**: Code follows style rules and best practices - - ❌ **FAIL**: Code has style violations or quality issues - - Run locally: `make ruff` - -2. **Type Checking (ty)** - Static type analysis - - ✅ **PASS**: No type errors detected - - ❌ **FAIL**: Type mismatches or missing annotations found - - Run locally: `make ty` - -3. **Testing (Multi-Version)** - Tests across Python 3.9 through 3.14 - - ✅ **PASS**: All tests pass on all supported Python versions - - ⚠️ **PARTIAL**: Tests pass on some versions but fail on others - - ❌ **FAIL**: Tests fail on one or more Python versions - - Run locally: `make test` - -**View CI/CD Status:** -- Click the badge above to see the full test results -- Each workflow shows which Python version(s) failed or passed -- Details are available in the Actions tab - ### Running Linters and Type Checks Before pushing changes, run these checks locally. Use `make lint` for everything, or run individual checks: @@ -585,11 +548,7 @@ This test validates installation and execution within a lightweight Linux VM on - Hashfile upload functionality - Complete job creation workflow -All tests use mocked API calls, so they can run without connectivity to a Hashview server. This allows tests to run in CI/CD environments (like GitHub Actions) without requiring actual API credentials. - -### Continuous Integration - -Tests automatically run on GitHub Actions for every push and pull request (Ubuntu, Python 3.9 through 3.14). +All tests use mocked API calls, so they can run without connectivity to a Hashview server. ------------------------------------------------------------------- @@ -791,8 +750,6 @@ Version 2.0+ - Added LLM Attack (option 15) using Ollama for AI-generated password candidates - Added Ollama configuration keys (ollamaModel, ollamaNumCtx) - Auto-versioning via setuptools-scm from git tags - - Automatic patch version bump (v2.0.1, v2.0.2, ...) on PR merge to main - - CI test fixes across Python 3.9-3.14 Version 2.0 Modularized codebase into CLI/API/attacks modules diff --git a/TESTING.md b/TESTING.md index 36021a1..25be6c2 100644 --- a/TESTING.md +++ b/TESTING.md @@ -128,10 +128,6 @@ The Lima test provisions a real Ubuntu 24.04 VM via [Lima](https://lima-vm.io/). - **HTTP mocking** - API tests mock `requests` at the boundary. No real network calls in offline tests. - **Subprocess mocking** - Hashcat wrapper tests mock `subprocess.Popen`; no hashcat binary required. -## CI - -GitHub Actions runs the offline test suite against Python 3.9-3.14 on every push and pull request. Opt-in tests are not run in CI. - Pre-push hooks (via [prek](https://github.com/j178/prek)) run `ruff`, `ty`, and `pytest` locally before each push: ```bash