Skip to content

Feature request: new cli option "--folder" for standalone version #118

Closed

Description

@stockbal

Hi,

First of all, thanks for the great tool 🚀, I like it a lot.

I want to propose a new command line option --folder to the standalone variant of the ABAP cleaner.
Background would be to easily run the cleaner over a large amount of ABAP files (e.g. a working copy of an abapGit repository).

At the moment I was able to do the same thing with a powershell script, which is fine, but slow if you have a lot of files to format (~40s for 50 files). I am guessing that this is because of the eclipse runtime that has to be loaded for each formatting call.
By introducing the --folder option the eclipse runtime would only be loaded once and could speed up the whole formatting immensly.

Let me know what you think about that.

Regards,
Ludwig

Activity

  1. jmgrassau commented on Sep 30, 2023

    @jmgrassau
    Member

    Hi Ludwig,

    as mentioned on your pull request, that's a great idea, and indeed there will be a huge performance gain with this, because ABAP cleaner (and esp. the RND Parser in it) then won't be initialized for each single file.

    And thanks so much for right away contributing the implementation – actually the first code contribution to ABAP cleaner since its Open-Source release! Assigning you to this issue to document this is already being worked on.

    Kind regards,
    Jörg-Michael

  2. jmgrassau commented on Sep 30, 2023

    @jmgrassau
    Member

    Hi Ludwig,

    meanwhile, I tested the new --sourcedir option, works like a charm!

    I must admit, though, that the getHelp() documentation as I suggested it, was rather confusing now, so I split it into two scenarios:

    Usage for single file:
        .\abap-cleanerc.exe {--sourcefile sourcefile / --source sourcecode } [--linerange linerange]
                            [{ --profile profile / --profiledata profiledata }] [--release release]
                            [--targetfile targetfile [--overwrite]] [--partialresult]
                            [--stats] [--usedrules]
    
    Example for single file:
        .\abap-cleanerc.exe --sourcefile "CL_ANY_CLASS.txt" --linerange "20-35" --profile "team profile.cfj" --release "757" --targetfile "result\CL_ANY_CLASS.txt" --overwrite --stats --usedrules
    
    Usage for multiple files:
        .\abap-cleanerc.exe --sourcedir sourcedir [--filepattern filepattern] [--recursive]
                            [{ --profile profile / --profiledata profiledata }] [--release release]
                            [--targetdir targetdir [--overwrite]]
                            [--stats] [--usedrules]
    
    Example for multiple files:
        .\abap-cleanerc.exe --sourcedir "C:\temp\source" --filepattern "*.txt" --recursive --profile "team profile.cfj" --release "757" --targetdir "C:\temp\target" --overwrite
    

    (then followed by the section with all the options of both cases).

    Kind regards,
    Jörg-Michael

  3. stockbal commented on Sep 30, 2023

    @stockbal
    ContributorAuthor

    Hi Jörg-Michael,

    great. Certainly makes the whole thing clearer for newbies 😄.

    Meanwhile I am working on a first version of a GitHub Workflow to automatically run ABAP Cleaner

    Kind regards,
    Ludwig

  4. jmgrassau commented on Oct 2, 2023

    @jmgrassau
    Member

    Hi Ludwig,

    thank you so much for this idea and contribution! I just released version 1.6.0, so the new command line options are now available to everyone!

    Meanwhile I am working on a first version of a GitHub Workflow to automatically run ABAP Cleaner

    Wow! Please keep us updated, so we could e.g. add a section in the documentation on how such a workflow can be set up.

    Kind regards,
    Jörg-Michael

  5. jelliottp commented on Oct 2, 2023

    @jelliottp

    I agree, the GHA workflow is an cool idea, I look forward to seeing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions