Skip to content

HTML reporting and scoring added#13

Merged
advaitpatel merged 4 commits into
OWASP:mainfrom
hafiz-Abdullahshahzad-DS:main
Jul 1, 2025
Merged

HTML reporting and scoring added#13
advaitpatel merged 4 commits into
OWASP:mainfrom
hafiz-Abdullahshahzad-DS:main

Conversation

@hafiz-Abdullahshahzad-DS
Copy link
Copy Markdown
Contributor

No description provided.

@advaitpatel advaitpatel merged commit a430501 into OWASP:main Jul 1, 2025
1 check passed
advaitpatel pushed a commit that referenced this pull request Nov 1, 2025
## feat: Dependencies, Testing, and Logging Improvements (Items #11-16)

**Related to:** Items #11-16 from CODE_REVIEW_AND_IMPROVEMENTS.md

### Overview
This PR completes Priority 1 improvements by adding dependency management, comprehensive test coverage, improved error handling, and structured logging. These changes enhance production readiness, maintainability, and developer experience.

---

### Dependencies & Configuration

#### Item #11: Pin dependency versions in requirements.txt
- **Problem**: No version pins - breaking changes in dependencies could break the tool unpredictably
- **Solution**:
  - Pinned all dependencies with version constraints in both `requirements.txt` and `setup.py`
  - Used semantic versioning ranges (e.g., `pydantic>=2.0.0,<3.0.0`)
  - Added comments to organize dependency groups
- **Files**: `requirements.txt`, `setup.py`
- **Impact**: Prevents unexpected breaking changes from dependency updates

**Example:**
```python
# Before
langchain
pydantic

# After
pydantic>=2.0.0,<3.0.0
langchain-core>=0.3.0,<2.0.0
langchain>=0.3.0,<2.0.0
```

#### Item #12: Fix Python version requirement mismatch
- **Problem**: `setup.py` requires Python 3.12, but `pyproject.toml` targeted Python 3.8
- **Solution**: Aligned Python version requirements to 3.12 across all configuration files
- **Files**: `setup.py`, `pyproject.toml`
- **Impact**: Prevents installation confusion and ensures consistency

**Changes:**
- `setup.py`: `python_requires=">=3.12"` (already correct)
- `pyproject.toml`: `target-version = ['py312']` (updated from `py38`)

---

### Error Handling & User Experience

#### Item #13: Improved error handling for missing external tools
- **Problem**: Tool checks existed but errors were not user-friendly - no installation guidance
- **Solution**:
  - Added `_get_tool_installation_instructions()` method with platform-specific installation steps
  - Integrated installation instructions into error messages
  - Provides clear guidance for Docker, Trivy, and Hadolint on Linux, macOS, and Windows
- **Files**: `docker_scanner.py`
- **Impact**: Significantly improved user experience when tools are missing

**Example Error Message (Before):**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants