Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
stockbal opened this issue Sep 27, 2023 · 5 comments
Closed

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

stockbal opened this issue Sep 27, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@stockbal
Copy link
Contributor

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

@jmgrassau
Copy link
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

@jmgrassau
Copy link
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

@stockbal
Copy link
Contributor Author

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

@jmgrassau
Copy link
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

@jelliottp
Copy link

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
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants