Closed madebylydia closed 1 year ago
Hi @Predeactor - thanks for getting in touch.
You can turn these off permanently by adding a setting to your user sourcery.yaml
file.
The file containing the setting would look like this:
refactor:
skip:
- function-quality
The location of this file is platform-dependent - you can find details here: https://docs.sourcery.ai/Reference/Configuration/Sources/
This does not seem to work
Just to be sure, I've created a sourcery.yaml
and .sourcery.yaml
but there is no change.
Do you have anything else perhaps?
Hi @Predeactor that's strange - could you post the file, its location and your OS, and make sure you've restarted VS Code?
One shortcut to making this work is also to take the 'Never show me this refactoring' option on a different refactoring and then edit the file it creates by changing the refactoring id.
Hey, I won't answer your question yet because, to my surprise, Sourcery does not work at all now! So no point trying to fix one thing if the whole thing doesn't work. There's just no suggestion at all...
I deleted the folder %AppData%/sourcery
and rebooted VSC. Nothing change, no suggestion...
And I am not working in a workspace, there's only this file opened
I'm quite stuck now... 😅
Oh no! Some questions:
sourcery.yaml
apparently'charmap' codec can't encode character '\U0001fa84' in position 2: character maps to
- Source: Sourcery (Extension)
I have sent you my log file in the given address!
Hmm - is there a sourcery folder in %LOCALAPPDATA% ? If so then could you post the contents of any sourcery.yaml file in there and then try removing it?
%LocalAppData%/sourcery/sourcery.yaml
exist... I know where this is getting x)
Content:
refactor:
rule_types: []
Deleted and... Oh, it works once again!
I tried to re-add the content of sourcery.yaml
from the beginning and surprisingly, there's no refactor again... The %LocalAppData/sourcery/sourcery.yaml
kicks-in again with the same content as above
Guess it shouldn't happens?
I added:
refactor:
skip:
- function-quality
to %LocalAppData/sourcery/sourcery.yaml
, and this time, it works just fine! The "Sourcery Code Metrics" is no more and Sourcery work just fine!
Should I keep this issue open so you can keep track of what happened today?
Yes - let's leave it open since it looks like there definitely might be some weird behaviour to investigate.
Really glad you got it working!
This configuration will stop Sourcery basically doing anything
refactor:
rule_types: []
as it is saying don't try any rule types.
The default config for this setting is:
refactor:
rule_types:
- refactoring
- suggestion
- comment
which enables all types of rule.
@Predeactor Do you know how your config got into this state?
@brendanator The only thing I've done to achieve this state is to put the following into %AppData%/sourcery/sourcery.yaml
:
refactor:
skip:
- function-quality
I guess that's because I do not specific rules in this file? 😛
I looks like there's three issues here:
%appdata%
when sourcery has put it in %localappdata%
rule_types: []
appeared in your config file
refactorings
, suggestions
and comments
to switch off Sourcery metrics?
- @Predeactor Do you know how this happened? Did you try clicking VSCode options to disable
refactorings
,suggestions
andcomments
to switch off Sourcery metrics?
Yes, all these settings were disabled actually
I actually am wondering if they had any effects actually, I feel like it was still working as expected before I try touching the sourcery.yaml
file manually.
Thanks @Predeactor, let's assume that this emptied the rule_types
then. Once the other two issues are completed I'll close this
Thanks for your detailed report and all your help 🙏
Made the fixes - now live.
how to permanently disable or remove Sourcery.ai? it's very annoy I cannot disable this modules, just feel be kidnaped by it, just malious software .
Hi, I'm a user of VSCode & Sourcery, and I very often read the comments of methods.
I am very annoyed by the "Sourcery Code Metrics" because this is irrelevant to me and sometime is buggy.
How do I remove it? There's no option in settings and I don't want it anywhere. Thank