Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 1.11 KB

CONTRIBUTING.md

File metadata and controls

40 lines (29 loc) · 1.11 KB

Contributing

This document, stolen from the Neofetch repository, describes the code style required when contributing to Winfetch.

Coding Conventions

  • No using PowerShell aliases. Please.
  • Use .NET functions where possible.
    • exception: write-host instead of console.writeline()
  • Don't throw exceptions.
    • Intead, write the error message in red and terminate (exit 1).
  • Indent 4 spaces.
  • Use snake_case for function and variable names.
  • Try to keep lines below 128 characters long.
  • Use lowercase for .NET functions where possible.
    • e.g. [text.encoding]::utf8.getstring((000,000,000)) instead of [Text.Encoding]::UTF8.GetString((000,000,000)).

Also, please test out your changes before submitting a PR.

Code Clauses

Do not put the else/elseif clause on a separate line:

if ($condition) {

}
else {}                # BAD

if ($condition) {

} else {

}                      # GOOD

if ($condition) {}
else {}                # THIS IS OK