You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’d like to be able to run tidyall on a project but have a configuration file located somewhere else.
Using --conf-file does not seem to simply read configuration from the specified file, but also changes the root directory to that of the file. Is this a deliberate functionality? If so, it would be nice if it was documented.
Then using --root-dir to ‘correct’ this, it seems global ignores don’t work as I would expect.
(It uses docker but the sh code could be run locally.)
It creates the following files:
a/
├── .tidyallrc
└── c
b/
├── d/
│ └── e
└── f
And a Tidy::All configuration that checks for an x in each file, but ignores d/**.
When run in a/ the result is as I expect; it tests a/c:
constructing Code::TidyAll with these params: {ignore => ['d/**'],no_cache => 1,plugins => {'GenericValidator / x' => {argv => 'x',cmd => 'grep',select => ['**/*']}},root_dir => '/root/a',verbose => 1}
purging old backups
[applying the following plugins: GenericValidator / x]
[checked] c (GenericValidator / x)
But when run in b/ with --conf-file ../a/.tidyallrc it still (only) tests a/c:
constructing Code::TidyAll with these params: {ignore => ['d/**'],no_cache => 1,plugins => {'GenericValidator / x' => {argv => 'x',cmd => 'grep',select => ['**/*']}},root_dir => '/root/a',verbose => 1}
[applying the following plugins: GenericValidator / x]
[checked] c (GenericValidator / x)
Adding --root-dir . makes it test b/f as expected, but it also tests (and fails on) b/d/e, which I would expect it to ignore:
constructing Code::TidyAll with these params: {ignore => ['d/**'],no_cache => 1,plugins => {'GenericValidator / x' => {argv => 'x',cmd => 'grep',select => ['**/*']}},root_dir => '.',verbose => 1}
purging old backups
[applying the following plugins: GenericValidator / x]
[checked] f (GenericValidator / x)
[applying the following plugins: GenericValidator / x]
[checked] d/e (GenericValidator / x)
grep x /tmp/Code-TidyAll-MJAz/d/e failed
exited with 1
As a final test I tried making a symlink from b/.tidyallrc to a/.tidyallrc, but that, to my great surprise, made the whole thing run in a:
constructing Code::TidyAll with these params: {ignore => ['d/**'],no_cache => 1,plugins => {'GenericValidator / x' => {argv => 'x',cmd => 'grep',select => ['**/*']}},root_dir => '/root/a',verbose => 1}
[applying the following plugins: GenericValidator / x]
[checked] c (GenericValidator / x)
Was I wrong in thinking --conf-dir would just specify a different configuration file?
Am I wrong in how I think the global ignores should work?
Are symlinked configuration files supposed to behave like above?!
Is there some other, well-defined, way of using a configuration file located outside of the current directory but have it behave in all other ways as if it was in the current directory?
Oh, and thanks for the great software. 😄
The text was updated successfully, but these errors were encountered:
I’d like to be able to run
tidyall
on a project but have a configuration file located somewhere else.Using
--conf-file
does not seem to simply read configuration from the specified file, but also changes the root directory to that of the file. Is this a deliberate functionality? If so, it would be nice if it was documented.Then using
--root-dir
to ‘correct’ this, it seems global ignores don’t work as I would expect.The following code reproduces the ‘issue’:
(It uses
docker
but thesh
code could be run locally.)It creates the following files:
And a Tidy::All configuration that checks for an
x
in each file, but ignoresd/**
.When run in
a/
the result is as I expect; it testsa/c
:But when run in
b/
with--conf-file ../a/.tidyallrc
it still (only) testsa/c
:Adding
--root-dir .
makes it testb/f
as expected, but it also tests (and fails on)b/d/e
, which I would expect it to ignore:As a final test I tried making a symlink from
b/.tidyallrc
toa/.tidyallrc
, but that, to my great surprise, made the whole thing run ina
:Was I wrong in thinking
--conf-dir
would just specify a different configuration file?Am I wrong in how I think the global ignores should work?
Are symlinked configuration files supposed to behave like above?!
Is there some other, well-defined, way of using a configuration file located outside of the current directory but have it behave in all other ways as if it was in the current directory?
Oh, and thanks for the great software. 😄
The text was updated successfully, but these errors were encountered: