Skip to content

Add Neva linter for style and harness checks #1140

Description

@emil14

Context

Several style concerns are valid code but should not become compiler errors:

  • one import block per file
  • import grouping/sorting
  • preferring compact chained connections where it improves scanability
  • warning on dense networks that should be extracted into helper components
  • requiring useful comments for exported entities/components
  • naming checks such as Enumerate returning Enumerated<T>, not unrelated Indexed<T>

These are lint-level concerns: a program may fail lint while still compiling, building, and running.

Desired shape

Add a first-class neva lint command as part of the default toolchain, separate from parser/analyzer/compiler semantics.

The compiler should keep rejecting invalid programs, while the linter reports maintainability/style findings. Tooling may run both together, but the implementation and error semantics should stay separate.

Initial rule candidates

  • single import block per file
  • import ordering/grouping according to docs/style_guide.md
  • exported entities must have a leading purpose comment
  • suggest chained connections for simple linear flows
  • flag dense networks above roughly 5-6 connections as extraction candidates
  • naming consistency for common stdlib result types and component/type pairs

Design notes

  • Ship out of the box with the main Neva tooling.
  • Keep the rule engine extensible so future users can add project/community rules.
  • Consider whether this should share infrastructure with a future test runner/plugin system.
  • Look at modern toolchain architectures such as Deno/Bun/Vite/Webpack for command/plugin boundaries, but keep Neva's compiler semantics independent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaThinking neededmediumDaysp2Someday we should do it. I hope

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions