Skip to content

alehander92/nim-linter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

nim-linter

niminal

# .nimlinter.yml
checks:
  NamingTypes: PascalCase
./linter linter.nim

Checks

Naming

Naming checks the convention of names

Currently we have 4: snake_case, camelCase, PascalCase and CAPITAL_CASE

NamingTypes

NamingTypes: convention

Checks the type naming. I visit the type sections only currently which should be probably sufficient for now. Default: PascalCase

NamingVariables

NamingVariables: convention

Checks variable naming: basically visiting idents that aren't supposed to be a type. Default: camelCase

NamingConstants

NamingConstants: convention

Checks const <name>. Default: camelCase (but I really love CAPITAL_CASE for constants)

NamingEnums

NamingEnums:on/off

Checks impure enums for having the same prefix

Layout

FunctionSpacing

FunctionSpacing: lines

Checks that at least lines lines are left between top level function definitions

Logic

NilCheck

NilCheck:on/off

Warns against <value> == nil and hints value.isNil

Cyclomatic

Cyclomatic:depth

Warns on highly nested loops and conditions

FunctionalLoop

FunctionalLoop:on/off

Warn when a loop can be expressed as a single mapIt / filterIt etc and hint a refactoring

NilFlow

NilFlow:on/off

Warn when a normal value is nil in a branch and it is used (with a field access / call): that leads to some false positives, so it's just a warning

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages