rdgd/twly

Unable to get .trc to read

Closed this issue · 3 comments

I've been attempting to set a more restrictive .trc up for a project but I'm having difficulties getting it read.

If I just put a .trc in the root of my application it appears to have no effect.

When I set a -t option that option prints as part of the output, but the output is clearly still using the defaults.

twly -t .trc
You passed your threshold of .trc% with a score of 99.84%

twly -t ../.trc
You passed your threshold of ./.trc% with a score of 99.84%

twly -t '../'
You passed your threshold of ./% with a score of 99.84%

Example of the .trc I'm using (over strict so I could tell if it worked)

  "threshold": 99,
  "ignore": ["node_modules/**/*.*", ".git/**/*.*"],
  "minLines": 2,
  "minChars": 10
}```

Do you have an example project setup by any chance? I'm running it with an npm script
"twly": "cd subProject/src && twly -t '../' ",

I have a subrepo 'subProject' that I'm running it against. 
rdgd commented

Hi @suni-masuno - Thanks for bringing this to my attention - I didn't see the notification when you filed this bug, but I will look into this and let you know the outcome!

rdgd commented

@suni-masuno - update for you. The issue you've noted will be addressed in this PR once it's merged #6

However, if you have the .trc file in the directory in which you are invoking the twly command, you don't even need to specify the path to it! It will be read and respected automatically if present. Any options passed to the twly command would override the configuration in the .trc file.

rdgd commented

@suni-masuno - This issue should be fixed with the just released v4.0.4. Also, be sure to surround the path to your config file in quotes... for example: twly --trc "./path/to/my/file.trc"

Let us know that this is fixed for you! Thanks!