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

Store configuration file path as relative to the project root #135

Closed
rock3r opened this issue Aug 16, 2021 · 5 comments · Fixed by #240
Closed

Store configuration file path as relative to the project root #135

rock3r opened this issue Aug 16, 2021 · 5 comments · Fixed by #240
Labels
feature New feature or request

Comments

@rock3r
Copy link
Contributor

rock3r commented Aug 16, 2021

Right now, as of v1.17.1, the Detekt configuration path is stored as an absolute path. Given that the Detekt IJ plugin settings are per-project, and thus saved in .idea/detekt.xml, this prevents folks from sharing the Detekt plugin configuration with other devs by committing the .idea/detekt.xml file as that contains absolute paths which will only work for one user.

This would easily be solved by using relative paths instead, referred to the project root directory.

@BorzdeG
Copy link
Contributor

BorzdeG commented Aug 16, 2021

used both 1.17.x and 1.18.0 (PR) - saved normally in the .idea/detekt.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="DetektProjectConfiguration">
    <enableDetekt>true</enableDetekt>
    <buildUponDefaultConfig>true</buildUponDefaultConfig>
    <configPaths>$PROJECT_DIR$/detekt.yml</configPaths>
  </component>
</project>

There is only a problem with the file selector settings - it displays the full path to the file, not a relative. But at the same time saved relative path

@rock3r
Copy link
Contributor Author

rock3r commented Aug 16, 2021

It saves them as absolute paths on my computer, but maybe it's because I used the file picker

@BorzdeG
Copy link
Contributor

BorzdeG commented Aug 16, 2021

I also use the file selection dialog

image

@rock3r
Copy link
Contributor Author

rock3r commented Aug 17, 2021

Hm it's the same I've done, but I'm on Windows. Maybe that's the difference

@cortinico cortinico added the feature New feature or request label Aug 19, 2021
@rock3r
Copy link
Contributor Author

rock3r commented Aug 7, 2022

I can confirm that the issue is that the IDE expects paths to be stored in POSIX format and will automatically relativize them only if they are in that format. I'm taking care of this as part of the work I am doing for #231 and the larger UI overhaul.

@rock3r rock3r mentioned this issue Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants