Skip to content

Conversation

perazz
Copy link
Member

@perazz perazz commented Aug 31, 2025

This PR adds new options to the fpm clean command for selectively deleting specific types of build artifacts:

  • --test - Delete only test executables
  • --apps - Delete only application executables
  • --examples - Delete only example executables

Usage

fpm clean --test # Delete only test executables
fpm clean --apps # Delete only app executables
fpm clean --examples # Delete only example executables
fpm clean --test --apps # Delete both test and app executables

This allows to quickly clean specific build artifacts without rebuilding everything.
Resolves requirement for selective build artifact cleanup. Close #1136

@perazz perazz requested a review from Copilot September 3, 2025 07:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds selective cleaning functionality to the fpm clean command, allowing users to delete specific types of build artifacts instead of the entire build directory. The implementation introduces new command-line flags (--test, --apps, --examples) and adds target-specific deletion logic.

  • Adds selective cleaning flags for test, app, and example executables
  • Refactors command-line parsing to use a shared build_settings helper
  • Implements target filtering and deletion for specific artifact types

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/fpm_command_line.f90 Adds new clean flags, refactors build settings initialization, and implements validation logic
src/fpm.f90 Implements target-specific deletion functionality with scope filtering
test/cli_test/cli_test.f90 Adds test cases for the new selective clean command options

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@perazz perazz merged commit e9f9476 into fortran-lang:main Sep 4, 2025
27 checks passed
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.

fine-grained cleaning: tests
1 participant