pylint by default will issue message C0103 for functions and methods that 
should be snake_case but aren't (Leo's configuration doesn't seem to pick 
that up).  Since the pylint message will include line and position of the 
name, it shouldn't be hard to write a program to convert these instances.  
If you did a string.replace() for each of them, the names would get fixed 
in docstrings and comments too.

Pylint by default issues the same warning for short variable names without 
an underscore like "x", too.  I don't know if that can be turned off or 
not, but I imagine it could be checked for easily.

On Wednesday, September 14, 2022 at 4:11:17 PM UTC-4 jkn wrote:

> Hi all
>     slightly OT but I think this is a good place to ask:
>
> I tend to write my personal python using camelCase for variables and 
> method names;
> I prefer this to the PEP8 standard for various reasons.
>
> I now have a need to convert some such scripts to snake_case, to meet
> a linting requirement. I thought that there would be plenty of tools to do 
> this,
> but rather to my surprise the various checkers and formatters I have found
> (in a fairly cursory search, admittedly) don't cater for this. They all do 
> plenty
> of other things, and I will definitely be using them in the future, but I 
> could
> do with this as a staring point.
>
> Any pointers to a tool which can do this job, probably with some flexible 
> configuration?
>
> Thanks & Regards
> J^n
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6b01ab73-423d-4c3c-b446-e037dd5225ean%40googlegroups.com.

Reply via email to