This directory contains centralized linting and code quality scripts for the CF Java Plugin project.
Python-specific linting and formatting script.
Usage:
./scripts/lint-python.sh [check|fix|ci]Modes:
check(default): Check code quality without making changesfix: Auto-fix formatting and import sorting issuesci: Strict checking for CI environments
Tools used:
flake8: Code linting (line length, style issues)black: Code formattingisort: Import sorting
Go-specific linting and testing script.
Usage:
./scripts/lint-go.sh [check|test|ci]Modes:
check(default): Run linting checks onlyci: Run all checks for CI environments (lint + dependencies)
Tools used:
gofumpt: Stricter Go code formatting (fallback togo fmt)go vet: Static analysisgolangci-lint: Comprehensive linting (detects unused interfaces, code smells, etc.)
Line Length Management:
The project enforces a 120-character line length limit via the lll linter. Note that Go
formatters (gofumpt/go fmt) do not automatically wrap long lines - this is by design
in the Go community. Manual line breaking is required for lines exceeding the limit.
Markdown-specific linting and formatting script.
Usage:
./scripts/lint-markdown.sh [check|fix|ci]Modes:
check(default): Check markdown quality without making changesfix: Auto-fix formatting issuesci: Strict checking for CI environments
Tools used:
markdownlint-cli: Markdown linting (structure, style, consistency)prettier: Markdown formatting
Comprehensive script that runs both Go and Python linting.
Usage:
./scripts/lint-all.sh [check|fix|ci]Features:
- Runs Go linting first, then Python (if test suite exists)
- Provides unified exit codes and summary
- Color-coded output with status indicators
Automatically updates README.md with current plugin help text.
Usage:
./scripts/update-readme-help.pyFeatures:
- Extracts help text using
cf java help - Updates help section in README.md
- Stages changes for git commit
- Integrated into pre-commit hooks
Requirements: CF CLI and CF Java plugin must be installed.
- golangci-lint: Install with
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - go: Go compiler and tools (comes with Go installation)
- flake8: Install with
pip install flake8 - black: Install with
pip install black - isort: Install with
pip install isort
- markdownlint-cli: Install with
npm install -g markdownlint-cli
To install all linting tools at once, run:
./setup-dev-env.shThis will install all required linters and development tools.
- Uses
lint-go.sh checkfor Go code - Uses
lint-python.sh fixfor Python code (auto-fixes issues) - Uses
update-readme-help.pyto keep README help text current
- Build & Snapshot: Uses
cimode for strict checking - PR Validation: Uses
cimode for comprehensive validation - Release: Uses
checkandtestmodes
- Local development: Use
checkmode for quick validation - Before commit: Use
fixmode to auto-resolve formatting issues - CI/CD: Uses
cimode for strict validation
All linting tools are configured via:
.golangci.yml: golangci-lint configuration (enables all linters except gochecknoglobals)test/pyproject.toml: Python tool configurationstest/requirements.txt: Python tool dependencies- Project-level files: Go module and dependencies
Virtual environments and build artifacts are automatically excluded from all linting operations.