Is it possible to configure detekt to allow charac...
# detekt
p
Is it possible to configure detekt to allow characters outside of the
a-z
range in e.g. function names? I see that `parameterPattern: '[a-z][A-Za-z0-9]*'`is used, but I would like to use the Norwegian characters
æ
,
ø
and
å
in function names, too. Any help would be highly appreciated!
Copy code
fun vilkårsØnske() {}
1
g
Can't you extend the regex to include those chars? Also using non ASCII chars in the source code sounds like a bad idea to be 😅
☝️ 1
p
yes, you are right, thank you. The solution is
Copy code
parameterPattern: '[a-zæøå][A-ZÆØÅa-zæøå0-9]*'
👍 2
Regarding using non-ASCII characters in the source code: our domain is heavily related to formal writings of several legal texts. It just makes sense to keep the definitions also in the source code to avoid confusion. Norwegian characters are part of the extended ASCII Codes and Java/Kotlin supports the entire Unicode character set for just this reason (ref Java Language Specification section 3.8)
👍 1