|
| 1 | +# VulnScan AI Makefile |
| 2 | +# Easy commands for development and testing |
| 3 | + |
| 4 | +.PHONY: help install test lint format security clean docker-build docker-run |
| 5 | + |
| 6 | +# Default target |
| 7 | +help: |
| 8 | + @echo "VulnScan AI - Available Commands:" |
| 9 | + @echo "" |
| 10 | + @echo "Development:" |
| 11 | + @echo " install - Install basic dependencies" |
| 12 | + @echo " install-full - Install all dependencies (including dev tools)" |
| 13 | + @echo " install-dev - Install in development mode" |
| 14 | + @echo " test - Run tests" |
| 15 | + @echo " test-with-coverage - Run tests with coverage report" |
| 16 | + @echo " lint - Run linting" |
| 17 | + @echo " format - Format code" |
| 18 | + @echo " security - Run security checks" |
| 19 | + @echo "" |
| 20 | + @echo "Docker:" |
| 21 | + @echo " docker-build - Build Docker image" |
| 22 | + @echo " docker-run - Run Docker container" |
| 23 | + @echo "" |
| 24 | + @echo "Utilities:" |
| 25 | + @echo " clean - Clean up generated files" |
| 26 | + @echo " scan-example - Run example scan" |
| 27 | + |
| 28 | +# Development commands |
| 29 | +install: |
| 30 | + pip install -r requirements-basic.txt |
| 31 | + |
| 32 | +install-full: |
| 33 | + pip install -r requirements.txt |
| 34 | + |
| 35 | +install-dev: |
| 36 | + pip install -r requirements.txt |
| 37 | + pip install -e . |
| 38 | + |
| 39 | +test: |
| 40 | + pytest tests/ -v |
| 41 | + |
| 42 | +test-with-coverage: |
| 43 | + pytest tests/ -v --cov=vulnscan_ai --cov-report=term-missing |
| 44 | + |
| 45 | +test-fast: |
| 46 | + pytest tests/ -v -m "not slow" |
| 47 | + |
| 48 | +lint: |
| 49 | + flake8 vulnscan_ai/ tests/ |
| 50 | + mypy vulnscan_ai/ |
| 51 | + |
| 52 | +format: |
| 53 | + black vulnscan_ai/ tests/ |
| 54 | + isort vulnscan_ai/ tests/ |
| 55 | + |
| 56 | +security: |
| 57 | + safety check |
| 58 | + bandit -r vulnscan_ai/ |
| 59 | + |
| 60 | +# Docker commands |
| 61 | +docker-build: |
| 62 | + docker build -t vulnscan-ai . |
| 63 | + |
| 64 | +docker-run: |
| 65 | + docker run --rm -it vulnscan-ai |
| 66 | + |
| 67 | +# Example scan |
| 68 | +scan-example: |
| 69 | + python -m vulnscan_ai.main httpbin.org --scan-types web ssl --output json |
| 70 | + |
| 71 | +# Clean up |
| 72 | +clean: |
| 73 | + find . -type f -name "*.pyc" -delete |
| 74 | + find . -type d -name "__pycache__" -delete |
| 75 | + find . -type d -name "*.egg-info" -exec rm -rf {} + |
| 76 | + rm -rf build/ |
| 77 | + rm -rf dist/ |
| 78 | + rm -rf htmlcov/ |
| 79 | + rm -rf .coverage |
| 80 | + rm -rf .pytest_cache/ |
| 81 | + |
| 82 | +# Full development setup |
| 83 | +setup: install-dev |
| 84 | + @echo "Setting up development environment..." |
| 85 | + @echo "Copy env.example to .env and update with your API keys" |
| 86 | + @echo "Run 'make test' to verify installation" |
0 commit comments