Code Cleanup

Automate C++ and Fortran code quality checks and cleanup tasks.

3|2|Updated Jul 5, 2023
One-click install
npx skills add https://github.com/SWMFsoftware/FLEKS --skill code-cleanup-swmfsoftware
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Code Cleanup
Source: https://github.com/SWMFsoftware/FLEKS/tree/main/.agent/skills/code-cleanup
Command: npx skills add https://github.com/SWMFsoftware/FLEKS --skill code-cleanup-swmfsoftware

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill addresses code quality issues by identifying and fixing common problems like unused variables, incorrect formatting, and outdated syntax, ensuring adherence to project coding standards.

Core Features & Use Cases

  • Automated Formatting: Applies consistent C++ and Fortran code formatting using clang-format and findent.
  • Issue Detection: Finds unused variables, raw new usage, NULL pointers, and incorrect using namespace declarations.
  • Automated Fixes: Includes scripts to automatically convert NULL to nullptr, remove trailing whitespace, and ensure files end with a newline.
  • Use Case: Before submitting a pull request, run this Skill to automatically format all C++ and Fortran files, check for common coding standard violations, and apply simple fixes, streamlining the review process.

Quick Start

Run the project's formatting script to format all C++ and Fortran source files.

Frequently Asked Questions about Code Cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate C++ and Fortran code formatting before a pull request?

Automate C++ and Fortran code formatting by running the project script that applies clang-format and findent to ensure consistent styling across all source files before submission.

What is the best way to find unused variables and NULL pointers in my codebase?

Identify unused variables and NULL pointers using automated code quality checks that detect these issues, and leverage scripts that automatically convert NULL to nullptr.

Does this code cleanup tool support both C++ and Fortran codebases?

Yes, the code cleanup tool supports both C++ and Fortran codebases, applying consistent formatting and detecting coding standard violations across both languages.

How do I remove trailing whitespace and ensure files end with a newline?

Remove trailing whitespace and enforce newline file endings by running the included automated fix scripts designed to clean up formatting inconsistencies.

Can I automatically fix incorrect using namespace declarations in C++?

Yes, you can identify incorrect using namespace declarations through the issue detection checks, which flag coding standard violations for manual review and deeper analysis.

What are the limitations of automated refactoring for C++ and Fortran?

Automated refactoring handles formatting and simple syntax fixes, but deeper code analysis and complex structural issues require manual checks and guidance.