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

[Bug] --ext-rules path in argument file should be relative to the argument file location #1071

Closed
rikerfi opened this issue Apr 16, 2024 · 3 comments · Fixed by #1081
Closed
Labels
bug Something isn't working

Comments

@rikerfi
Copy link
Contributor

rikerfi commented Apr 16, 2024

What happened?

Running robocop with --ext-rules parameter takes a path relative to the location where the robocop is launched. When using the argument file with -A parameter then --ext-rules should be relative to the argument file.

What command/code did you try to run?

robocop tests/ -A tests/roboargs.txt

Argument file has following line:
--ext-rules libraries/robocop/

External rules are located to /tests/libraries/robocop

What is the full error message?

Error: Fatal error: Failed to load external rules from file "/libraries/robocop/". Verify if the file exists

What did you expect to happen instead?

Get ext-rules from the relative location to the argument file location.

For example in argument file:
--ext-rules libraries/robocop/ could point relative to the argument file and --ext-rules ./libraries/robocop/ could point relative to location robocop is launched.

Operating System

Linux

Robocop version

5.0.4

@rikerfi rikerfi added the bug Something isn't working label Apr 16, 2024
@bhirsz
Copy link
Member

bhirsz commented Apr 17, 2024

I'm quite sure I have implemented something similiar in Robocop (after Robotidy, which uses completely different config implementation). I need to check if I simply missed --ext-rules option or there is new bug introduced.

@bhirsz
Copy link
Member

bhirsz commented Apr 17, 2024

@bhirsz
Copy link
Member

bhirsz commented May 7, 2024

I have checked and we indeed resolve relative paths for some options in the configuration files but for some reason I used 'config directory' as base for toml files and project root fro arg files. It looks like bug, I will fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants