robotframework-robocop icon indicating copy to clipboard operation
robotframework-robocop copied to clipboard

[Bug] The --ext-rules option does properly support a relative path

Open sekwahs opened this issue 2 years ago • 1 comments

What happened?

When a relative path is used with --ext-rules it works only if robocop is invoked from a directory for which the relative path is valid. This is an issue when specifying --ext-rules in a .robocop file since in that case it does not work if, for example, you invoke robocop from a subdirectory of the directory containing the .robcop file.

As an example, the following entry in .robocop works only if robocop is invoked from the same directory that contains the .robocop file.

--ext-rules .robocop-custom.py

Operating System

No response

Robocop version

>= 2.0.1

sekwahs avatar Sep 01 '22 17:09 sekwahs

Thank you for the report. It was reported some time ago and I've decided to fix it only for pyproject.toml. .robocop requires more work. But since it's the second time it's reported I will think about it if it's worth the time invested.

It's also described in our docs in https://robocop.readthedocs.io/en/stable/user_guide.html -> "Loading configuration from file" -> "Relative paths in the configuration".

The workaround for you is to use pyproject.toml instead or use absolute paths.

bhirsz avatar Sep 02 '22 06:09 bhirsz