Skip to content

Dev

LOKESH MANCHALA requested to merge dev into main

What does this MR do?

This MR enhances the project compliance checker by improving the detection of the Ruff linter configuration in the .vscode/settings.json file and adds support for verifying the presence of the .vscode/tasks.json file. Additionally, relevant documentation snippets and suggestions for tasks.json have been integrated into the UI.

Motivation

Previously, the checker did not monitor the presence of tasks definitions in .vscode/tasks.json, which are useful for automating build, lint, and deployment workflows within VSCode. Including this check increases adherence to best practices and project maintainability.

The Ruff linter detection was refined to ensure it correctly identifies various valid configurations in settings.json. This improves accuracy in compliance reporting and guides contributors to maintain consistent linting setups.

Scope of Changes

  • Updated the compliance check logic to include .vscode/tasks.json presence.
  • Enhanced check_vscode_settings_content to robustly detect Ruff configuration in multiple variants.
  • Extended the compliance summary UI to report on tasks.json and Ruff presence distinctly.
  • Added new entries in suggestions and documentation sections for tasks.json.
  • Minor improvements to existing messages ensuring clarity and completeness.
  • No breaking changes to existing functionality or user workflows.

Risks and Mitigation

  • The changes are additive and focus on detection and reporting; thus, risk of breaking existing features is minimal.
  • Parsing of JSON files in the repository is wrapped in exception handling to avoid runtime failures.
  • The code was tested locally against repositories with various VSCode configurations, including those lacking or containing valid tasks.json and Ruff entries.
  • UI was verified for correct display of new compliance entries and documentation snippets.

How to Test

  1. Check out the branch locally.
  2. Run the Streamlit app.
  3. Use the compliance checker on projects with and without .vscode/tasks.json and with varying Ruff settings in .vscode/settings.json.
  4. Verify the compliance report correctly reflects presence or absence of:
    • .vscode/tasks.json
    • Ruff configuration in .vscode/settings.json
  5. Confirm that the suggestions display missing items appropriately, with relevant images showing.
  6. Expand the documentation accordions for VSCode and Python configs to ensure the new tasks.json section appears when missing.
  7. Run existing unit tests (if any) and ensure no regressions occur.

Checklist

  • Code is more maintainable and easier to understand
  • No functional or UI breaking changes
  • Existing tests pass
  • Documentation updated with tasks.json details and improved Ruff guidance

Related Issues

  • Addresses support and documentation for VSCode tasks detection in compliance tooling.
  • Improves linter configuration detection accuracy related to project compliance.
  • Part of ongoing enhancements to project compliance and developer experience in tooling.

Merge request reports

Loading