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
CLI should use consistent system-dependent path separators #1253
Comments
Hm, platform specific separators could be confusing if you use both windows and *nix? |
You need to use |
How about we agree on something that works for everyone? I don't like the idea of checking of which OS you use and depending on that configure the CLI parameters. Also this probably means another breaking change :( |
That's the problem... there won't be a single separator that works for everyone (just like the path separator is different on *nix and Windows, so the CLI parameters will always be different on the two platforms anyway). But, as long as a |
Hm if I read the conversation again, I think we should change the separator and introduce a breaking change her :(. |
That's all doable. JCommander supports variable arity which allows As for leaving just But perhaps this change should be deferred to a detekt 2.0 release, rather than another breaking change before 1.0? |
Hm I think most users use the gradle plugin and this would "only" affect cli users. |
Having a hard time imaging the changes here. Can you give a concrete example of the current configuration and how you want to change it? |
Actually maybe all of these |
Since this issue became quite stale, what are we going to do about? |
I propose that for detekt 2.0 the path separators are updated so they're system-dependent for any CLI options that accept multiple paths. That's the convention used for both I don't have as strong an opinion on the other options since I use detekt from Gradle so I don't have to worry about any issues with those. |
This issue is stale because it has been open 90 days with no activity. Please comment or this will be closed in 7 days. |
Expected Behavior
Consistent/expected path separators are used. Standard for Java tools is to use
(a space) for separation of Ant-style filters.
:
on *nix and;
on Windows for path separation, and,
orCurrent Behavior
Bit of a mixed bag.
--input
,--plugin
,--config
&--config-resource
accept both,
and;
as path separators regardless of platform.--report
is an odd one, since it requires using:
as an internal separator between components of the input command (e.g.-r txt:reports/detekt.txt
). This caused issues on Windows (now worked around).--filters
separates on,
and;
but is a bit different in scope since the value is typically quoted.Context
Several issues in the past with Windows related to handling of path separation. Consistency with other tools.
Proposal is:
--input
,--plugin
,--config
&--config-resource
allow path separation using only:
on *nix and;
on Windows--report
is deprecated in its current form. Introduce--report-txt
,--report-xml
and--report-html
which each accept a single path to the desired output file. No parsing of input is required except to convert to a file path.--filters
accepts either"<filter-1> <filter-2>"
(quoted, space-separated),"<filter-1>,<filter-2>"
(quoted, comma-separated),<filter-1> <filter-2>
(unquoted, space-separated),<filter-1>,<filter-2>
(unquoted, comma-separated).Of course, these conventions will have to be enforced as rules going forward as new parameters are introduced.
Your Environment
The text was updated successfully, but these errors were encountered: