Skip to content

Add markdown report documentation scoring tool#224

Open
pranavisrikanth wants to merge 2 commits into
mainfrom
tools/report-doc-scoring
Open

Add markdown report documentation scoring tool#224
pranavisrikanth wants to merge 2 commits into
mainfrom
tools/report-doc-scoring

Conversation

@pranavisrikanth
Copy link
Copy Markdown
Collaborator

Summary

This PR adds a Python utility script that scores markdown report documentation quality based on required report sections.

The tool checks whether a markdown file contains key report headings and calculates a documentation quality score out of 100.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor / code cleanup
  • Documentation
  • CI/CD / infrastructure
  • Security

Affected Components

  • /backend-api
  • /frontend
  • /engine (collectors / policies)
  • /security
  • /infrastructure
  • /.github/workflows
  • /docs

Motivation

This tool supports GRC/reporting documentation consistency by giving contributors a simple score-based way to assess whether markdown report artefacts contain required sections.

Testing Done

  • Unit tests pass locally
  • Tested manually — describe how:
  • No tests required — explain why:

Tested manually by running:

python tools/score_report_doc_quality.py README.md

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 635ccf48f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


score = 0

for section, points in SCORING_SECTIONS.items():
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse headings instead of exact stripped-line equality

The section check uses exact string equality (if section in lines), so valid Markdown ATX headings with optional closing hashes (for example, ## Purpose ##) are scored as missing even when all required sections are present. This produces false negatives and causes the CLI to return a non-zero exit code for compliant documents whenever authors use alternate-but-valid heading syntax.

Useful? React with 👍 / 👎.

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.

1 participant