1 | #! /usr/bin/env python |
||
0 ignored issues
–
show
|
|||
2 | # |
||
3 | # Copyright (C) 2015-2016 Rich Lewis <[email protected]> |
||
4 | # License: 3-clause BSD |
||
5 | |||
6 | 1 | import re |
|
7 | |||
8 | |||
9 | 1 | def camel_to_snail(s): |
|
0 ignored issues
–
show
The name
s does not conform to the argument naming conventions ([a-z_][a-z0-9_]{2,30}$ ).
This check looks for invalid names for a range of different identifiers. You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements. If your project includes a Pylint configuration file, the settings contained in that file take precedence. To find out more about Pylint, please refer to their site. ![]() |
|||
10 | """ Convert CamelCase to snail_case. """ |
||
11 | 1 | return re.sub('(?!^)([A-Z]+)', r'_\1', s).lower() |
|
12 | |||
13 | |||
14 | 1 | def free_to_snail(s): |
|
0 ignored issues
–
show
The name
s does not conform to the argument naming conventions ([a-z_][a-z0-9_]{2,30}$ ).
This check looks for invalid names for a range of different identifiers. You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements. If your project includes a Pylint configuration file, the settings contained in that file take precedence. To find out more about Pylint, please refer to their site. ![]() |
|||
15 | """ Convert Free Case to snail_case. """ |
||
16 | return s.strip().lower().replace(' ', '_') |
||
17 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.