feat: enhance compliance check with content validation and category report
What does this MR do?
This MR enhances the GitLab Project Compliance Checker to validate the content of key configuration files, not just their presence. It introduces:
-
✅ AGPLv3 license validation: Ensures theLICENSEfile is truly AGPLv3, not just namedLICENSE. -
✅ .vscode/settings.jsoncontent checks: Validates that the file includesrufffor linting anduvfor environment management. -
✅ Improved feedback: Uses yellow (🟠) status when a license is present but incorrect (e.g., MIT/Apache). -
✅ Better UX: Showsfiles.pngonly in suggestions, when template folders are missing. -
✅ Faster performance: Uses caching to avoid redundant GitLab API calls. -
✅ Enter key support: Pressing Enter in the project input now triggers the check.
This ensures projects meet organizational compliance standards at both structure and content levels.
Motivation / Use Case
Our team requires:
- All open-source projects to use AGPLv3, not permissive licenses like MIT.
- Standardized development environments using
ruff(linter) anduv(Python installer). - Clear, actionable feedback when projects are non-compliant.
Previously, the tool only checked if files existed. This MR ensures they are correctly configured, preventing false positives and enforcing best practices.
Implementation Notes
-
Caching: Used
@st.cache_dataon file reads (read_file_content) to speed up checks. -
Content Validation:
-
check_license_content()parsesLICENSEand checks for AGPLv3-specific phrases. -
check_vscode_settings_content()parses.vscode/settings.jsonand verifiesruffanduvusage.
-
-
Image Logic:
files.pngnow shows only in suggestions and only if.gitlab/issue_templatesor.gitlab/merge_request_templatesis missing. -
No Truncation: All
.mdfiles in template folders are shown in full (e.g.,5 file(s) (Bug.md, Default.md, Documentation.md, ...)). -
Enter Key Support: Added
on_changecallback to trigger checks on Enter. - Backward Compatible: No breaking changes. Existing modes ("User Profile README", "Get User Info") are unchanged.
How to Test
- Pull the branch:
- git fetch origin
- git checkout your-branch-name
- Run the Streamlit app:
- streamlit run app.py
- Test in "Check Project Compliance" mode:
- Enter a project path/URL and press Enter or click "Check Compliance".
- Verify:
-
✅ IfLICENSEis MIT/Apache → shows🟠 LICENSE is AGPLv3. -
✅ If.vscode/settings.jsonlacksruff/uv→ shows❌ .vscode/settings.json has Ruff/UV. -
✅ If template folders are missing →files.pngappears in suggestions. -
✅ If all checks pass → shows🎉 All Set!.
-
- Test with projects that have:
- AGPLv3 vs MIT license
-
.vscode/settings.jsonwith and withoutruff/uv - Missing or present template folders
- Verify other modes still work:
- Switch to "Check User Profile README" and "Get User Info" — they should work as before.
Checklist
-
Feature is documented (in README or relevant doc files) -
Code is clean, readable, and follows the project style -
No breaking changes (or documented if there are) -
Tests are added or updated -
Feature works as intended in local testing
Related Issues or Discussions
- Implements:
feat(compliance): validate LICENSE and vscode settings content - Closes: #1 (closed)