Scony / godot-gdscript-toolkit

Independent set of GDScript tools - parser, linter, formatter, and more
MIT License
983 stars 68 forks source link

String formatting inside a function results in unnecessary extra parenthesis #305

Open SirMoM opened 4 months ago

SirMoM commented 4 months ago

The formatter turns this:

print("[ERROR] [logger] Could not create the '%s' directory; exited with error %d." % [base_dir, err])

Into this:

print(
    (
        "[ERROR] [logger] Could not create the '%s' directory; exited with error %d."
        % [base_dir, err]
    )
)

My rc file:

class-definitions-order:
- tools
- classnames
- extends
- docstrings
- signals
- enums
- consts
- exports
- pubvars
- prvvars
- onreadypubvars
- onreadyprvvars
- staticvars
- others
class-load-variable-name: (([A-Z][a-z0-9]*)+|_?[a-z][a-z0-9]*(_[a-z0-9]+)*)
class-name: ([A-Z][a-z0-9]*)+
class-variable-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)*
comparison-with-itself: null
constant-name: _?[A-Z][A-Z0-9]*(_[A-Z0-9]+)*
duplicated-load: null
enum-element-name: '[A-Z][A-Z0-9]*(_[A-Z0-9]+)*'
enum-name: ([A-Z][_a-z0-9]*)+
excluded_directories: !!set
  .git: null
expression-not-assigned: null
function-argument-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)*
function-arguments-number: 10
function-name: (_on_([A-Z][a-z0-9]*)+(_[a-z0-9]+)*|_?[a-z][a-z0-9]*(_[a-z0-9]+)*)
function-preload-variable-name: ([A-Z][a-z0-9]*)+
function-variable-name: '[a-z][a-z0-9]*(_[a-z0-9]+)*'
load-constant-name: (([A-Z][a-z0-9]*)+|_?[A-Z][A-Z0-9]*(_[A-Z0-9]+)*)
loop-variable-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)*
max-returns: 6
mixed-tabs-and-spaces: false
no-elif-return: null
no-else-return: null
private-method-call: null
signal-name: '[a-z][a-z0-9]*(_[a-z0-9]+)*'
sub-class-name: _?([A-Z][a-z0-9]*)+
tab-characters: 1
trailing-whitespace: null
unnecessary-pass: null
unused-argument: null
max-line-length: 10000
disable: [class-definitions-order, max-file-lines, max-line-length, max-public-methods, no-else-return]