tb_lint.linters package

Submodules

tb_lint.linters.naturaldocs_linter module

NaturalDocs Linter Implementation

Company: Copyright (c) 2025 BTA Design Services

Licensed under the MIT License.

Description: Adapter for NaturalDocs documentation linting using Verible AST

class tb_lint.linters.naturaldocs_linter.ASTContext(tree: any, file_bytes: bytes)[source]

Bases: object

Context object containing AST and file data

tree: any
file_bytes: bytes
__init__(tree: any, file_bytes: bytes) None
class tb_lint.linters.naturaldocs_linter.NaturalDocsLinter(config: dict | None = None)[source]

Bases: BaseLinter

NaturalDocs documentation linter using Verible AST parser

This linter checks SystemVerilog files for proper NaturalDocs documentation using Abstract Syntax Tree analysis for high accuracy.

property name: str

Name of this linter

Returns:

String name of the linter

property supported_extensions: List[str]

File extensions this linter can handle

Returns:

List of file extensions (e.g., [‘.sv’, ‘.svh’])

__init__(config: dict | None = None)[source]

Initialize NaturalDocs linter

Parameters:

config – Configuration dictionary

prepare_context(file_path: str, file_content: str) ASTContext | None[source]

Prepare AST context by parsing file with Verible

Parameters:
  • file_path – Path to file

  • file_content – Content of file

Returns:

ASTContext with parsed AST tree, or None on failure

tb_lint.linters.verible_linter module

Verible Linter Implementation

Company: Copyright (c) 2025 BTA Design Services

Licensed under the MIT License.

Description: Adapter for Verible style and syntax linting

class tb_lint.linters.verible_linter.VeribleLinter(config: dict | None = None)[source]

Bases: BaseLinter

Verible syntax and style linter

This linter wraps the verible-verilog-lint tool and converts its output into the unified format.

property name: str

Name of this linter

Returns:

String name of the linter

property supported_extensions: List[str]

File extensions this linter can handle

Returns:

List of file extensions (e.g., [‘.sv’, ‘.svh’])

__init__(config: dict | None = None)[source]

Initialize Verible linter

Parameters:

config – Configuration dictionary

prepare_context(file_path: str, file_content: str) any | None[source]

Prepare context for Verible

For Verible, we don’t need to prepare any context since it’s an external tool. We just return a dummy context.

Returns:

Empty dict (Verible doesn’t need context preparation)

lint_file(file_path: str) LinterResult[source]

Lint a single file using Verible

Override the base method to call verible-verilog-lint directly

Parameters:

file_path – Path to file to lint

Returns:

LinterResult containing violations found

Module contents

Linter implementations

Company: Copyright (c) 2025 BTA Design Services

Licensed under the MIT License.

class tb_lint.linters.NaturalDocsLinter(config: dict | None = None)[source]

Bases: BaseLinter

NaturalDocs documentation linter using Verible AST parser

This linter checks SystemVerilog files for proper NaturalDocs documentation using Abstract Syntax Tree analysis for high accuracy.

property name: str

Name of this linter

Returns:

String name of the linter

property supported_extensions: List[str]

File extensions this linter can handle

Returns:

List of file extensions (e.g., [‘.sv’, ‘.svh’])

__init__(config: dict | None = None)[source]

Initialize NaturalDocs linter

Parameters:

config – Configuration dictionary

prepare_context(file_path: str, file_content: str) ASTContext | None[source]

Prepare AST context by parsing file with Verible

Parameters:
  • file_path – Path to file

  • file_content – Content of file

Returns:

ASTContext with parsed AST tree, or None on failure

class tb_lint.linters.VeribleLinter(config: dict | None = None)[source]

Bases: BaseLinter

Verible syntax and style linter

This linter wraps the verible-verilog-lint tool and converts its output into the unified format.

property name: str

Name of this linter

Returns:

String name of the linter

property supported_extensions: List[str]

File extensions this linter can handle

Returns:

List of file extensions (e.g., [‘.sv’, ‘.svh’])

__init__(config: dict | None = None)[source]

Initialize Verible linter

Parameters:

config – Configuration dictionary

prepare_context(file_path: str, file_content: str) any | None[source]

Prepare context for Verible

For Verible, we don’t need to prepare any context since it’s an external tool. We just return a dummy context.

Returns:

Empty dict (Verible doesn’t need context preparation)

lint_file(file_path: str) LinterResult[source]

Lint a single file using Verible

Override the base method to call verible-verilog-lint directly

Parameters:

file_path – Path to file to lint

Returns:

LinterResult containing violations found