Skip to content

Linter #247

@maxitg

Description

@maxitg

The code consistency is currently somewhat out of whack. Tabs and spaces are used inconsistently, indentation is different, the line width is not enforced, etc.

We need a linter that would work along with CI and if not automatically fix then at least detect issues with code style and consistency.

Some lint tests we might want are:

  • Flatten/ReplaceAll/Thread used without an explicit level spec (might need a different mechanism for Thread).
  • Module/With/Block:
    • Missing definitions;
    • Unused definitions.
  • Static WL code analysis
  • Spacing issues
    • Enforce line width;
    • Check there are no tabs;
    • No spaces at the end of files;
    • No more than 2 spaces in between characters (unless followed by a comment);
    • No more than 2 empty lines at a time;
    • Empty lines present at the end of files.
  • Wolfram Language code formatting
    • Indentation;
    • Check there are either always or never semicolons at the end of definitions.
  • Check for broken links
  • Tools from GeneralUtilities` :
    • FindDeadCode.

Linters we need:

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality, or change in existing functionalityinfrastructureHas to do with changes to the development process, e.g., build scripts, CI, testing utilities

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions