Skip to content

Conversation

@Joschi3
Copy link
Member

@Joschi3 Joschi3 commented Apr 17, 2025

Summary

This PR enhances the pre-commit checks with additional validation and formatting steps to improve consistency and catch common errors early.

Changes

  • YAML & XML validation

    • Checks for syntax validity of config and launch files.
  • Unfinished merge commit detection

    • Adds a hook to catch and block leftover merge commits.
  • CMakeLists formatting

    • Applies consistent formatting to CMakeLists.txt.
  • package.xml formatting and verification

    • Ensures correct element ordering (especially dependencies).
    • Groups and alphabetically sorts all dependencies.
    • Verifies all dependencies can be resolved with rosdep.
    • Checks that all dependencies required by CMake (where the rosdep key can be trivially inferred) are declared in package.xml as build or test dependencies.
    • Auto-formats trivial errors and lists non-trivially resolvable or missing dependency errors.

@Joschi3 Joschi3 requested a review from Excelsius314 April 17, 2025 12:58
@Joschi3 Joschi3 self-assigned this Apr 17, 2025
@Joschi3
Copy link
Member Author

Joschi3 commented Apr 24, 2025

Updated tuda_workspace scripts to automatically install the pre-commit hooks after creating the pre-commit config. Moreover, pre-commit itself is installed if it is missing.

You can manually install and run pre-commits with pre-commit install and pre-commit run --all-files.

@Excelsius314
Copy link

Need to add local ros packages as possible dependencies

@Excelsius314
Copy link

Add warning if no parameter loading type is specified

@Excelsius314
Copy link

Add pre-commit autoupdate to hector update

@Excelsius314
Copy link

Add missing dependencies from cmake automatically to package.xml (Possibly as user if they should be build_depend only)

@Joschi3
Copy link
Member Author

Joschi3 commented May 11, 2025

@Joschi3 Joschi3 force-pushed the feature/improved_pre_commits branch from 4c2cac8 to e0988c0 Compare May 11, 2025 18:22
@Excelsius314 Excelsius314 merged commit b1d3821 into main May 12, 2025
38 checks passed
@Joschi3 Joschi3 deleted the feature/improved_pre_commits branch May 22, 2025 07:45
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.

3 participants