sattlint 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sattlint-1.0.0/LICENSE +21 -0
- sattlint-1.0.0/PKG-INFO +275 -0
- sattlint-1.0.0/README.md +232 -0
- sattlint-1.0.0/pyproject.toml +130 -0
- sattlint-1.0.0/setup.cfg +4 -0
- sattlint-1.0.0/src/sattlint/__init__.py +99 -0
- sattlint-1.0.0/src/sattlint/__main__.py +6 -0
- sattlint-1.0.0/src/sattlint/__version__.py +3 -0
- sattlint-1.0.0/src/sattlint/analyzers/__init__.py +3 -0
- sattlint-1.0.0/src/sattlint/analyzers/_alarm_path_traversal.py +252 -0
- sattlint-1.0.0/src/sattlint/analyzers/_dependency_usage_scope_support.py +232 -0
- sattlint-1.0.0/src/sattlint/analyzers/_modules_debug.py +78 -0
- sattlint-1.0.0/src/sattlint/analyzers/_modules_diffing.py +332 -0
- sattlint-1.0.0/src/sattlint/analyzers/_modules_fingerprints.py +321 -0
- sattlint-1.0.0/src/sattlint/analyzers/_modules_reporting.py +273 -0
- sattlint-1.0.0/src/sattlint/analyzers/_registry_dispatch.py +189 -0
- sattlint-1.0.0/src/sattlint/analyzers/_registry_spec_templates.py +653 -0
- sattlint-1.0.0/src/sattlint/analyzers/_registry_specs.py +124 -0
- sattlint-1.0.0/src/sattlint/analyzers/_sattline_semantic_contracts.py +273 -0
- sattlint-1.0.0/src/sattlint/analyzers/_sattline_semantic_issue_mapping.py +235 -0
- sattlint-1.0.0/src/sattlint/analyzers/_sattline_semantic_models.py +63 -0
- sattlint-1.0.0/src/sattlint/analyzers/_sattline_semantic_rules.py +278 -0
- sattlint-1.0.0/src/sattlint/analyzers/_sattline_semantic_rules_data.py +415 -0
- sattlint-1.0.0/src/sattlint/analyzers/_sattline_semantic_rules_more_data.py +210 -0
- sattlint-1.0.0/src/sattlint/analyzers/_wave2_node_traversal.py +305 -0
- sattlint-1.0.0/src/sattlint/analyzers/_wave2_support.py +353 -0
- sattlint-1.0.0/src/sattlint/analyzers/alarm_integrity.py +614 -0
- sattlint-1.0.0/src/sattlint/analyzers/catalog.py +68 -0
- sattlint-1.0.0/src/sattlint/analyzers/comment_code.py +117 -0
- sattlint-1.0.0/src/sattlint/analyzers/config_drift.py +155 -0
- sattlint-1.0.0/src/sattlint/analyzers/cyclomatic_complexity.py +319 -0
- sattlint-1.0.0/src/sattlint/analyzers/data_dependency.py +145 -0
- sattlint-1.0.0/src/sattlint/analyzers/dataflow/__init__.py +467 -0
- sattlint-1.0.0/src/sattlint/analyzers/dataflow/_dataflow_common.py +49 -0
- sattlint-1.0.0/src/sattlint/analyzers/dataflow/_dataflow_condition_expr.py +145 -0
- sattlint-1.0.0/src/sattlint/analyzers/dataflow/_dataflow_condition_facts.py +111 -0
- sattlint-1.0.0/src/sattlint/analyzers/dataflow/_dataflow_conditions.py +611 -0
- sattlint-1.0.0/src/sattlint/analyzers/dataflow/_dataflow_issue_reporting.py +180 -0
- sattlint-1.0.0/src/sattlint/analyzers/dataflow/_dataflow_scope_support.py +128 -0
- sattlint-1.0.0/src/sattlint/analyzers/dataflow/_dataflow_state.py +231 -0
- sattlint-1.0.0/src/sattlint/analyzers/dataflow/_dataflow_traversal.py +507 -0
- sattlint-1.0.0/src/sattlint/analyzers/dispatch.py +106 -0
- sattlint-1.0.0/src/sattlint/analyzers/fault_handling.py +121 -0
- sattlint-1.0.0/src/sattlint/analyzers/framework/__init__.py +257 -0
- sattlint-1.0.0/src/sattlint/analyzers/framework/_shared_analysis.py +43 -0
- sattlint-1.0.0/src/sattlint/analyzers/framework/issue.py +28 -0
- sattlint-1.0.0/src/sattlint/analyzers/icf/__init__.py +835 -0
- sattlint-1.0.0/src/sattlint/analyzers/icf/_icf_datatype_resolution.py +42 -0
- sattlint-1.0.0/src/sattlint/analyzers/icf/_icf_file_io.py +218 -0
- sattlint-1.0.0/src/sattlint/analyzers/initial_values.py +444 -0
- sattlint-1.0.0/src/sattlint/analyzers/interface_contracts.py +106 -0
- sattlint-1.0.0/src/sattlint/analyzers/layout_geometry.py +228 -0
- sattlint-1.0.0/src/sattlint/analyzers/loop_output_refactor.py +352 -0
- sattlint-1.0.0/src/sattlint/analyzers/loop_stability.py +95 -0
- sattlint-1.0.0/src/sattlint/analyzers/mms/__init__.py +265 -0
- sattlint-1.0.0/src/sattlint/analyzers/mms/_mms_icf_inventory.py +87 -0
- sattlint-1.0.0/src/sattlint/analyzers/mms/_mms_interface_analysis.py +422 -0
- sattlint-1.0.0/src/sattlint/analyzers/mms/_mms_interface_helpers.py +274 -0
- sattlint-1.0.0/src/sattlint/analyzers/modules.py +437 -0
- sattlint-1.0.0/src/sattlint/analyzers/naming.py +334 -0
- sattlint-1.0.0/src/sattlint/analyzers/numeric_constraints.py +162 -0
- sattlint-1.0.0/src/sattlint/analyzers/parameter_drift.py +281 -0
- sattlint-1.0.0/src/sattlint/analyzers/picture_display_paths.py +37 -0
- sattlint-1.0.0/src/sattlint/analyzers/powerup.py +68 -0
- sattlint-1.0.0/src/sattlint/analyzers/registry/__init__.py +667 -0
- sattlint-1.0.0/src/sattlint/analyzers/registry/_registry_delivery.py +110 -0
- sattlint-1.0.0/src/sattlint/analyzers/registry/_registry_delivery_data.py +374 -0
- sattlint-1.0.0/src/sattlint/analyzers/reset_contamination/__init__.py +568 -0
- sattlint-1.0.0/src/sattlint/analyzers/reset_contamination/_reset_latching.py +438 -0
- sattlint-1.0.0/src/sattlint/analyzers/reset_contamination/_reset_latching_paths.py +328 -0
- sattlint-1.0.0/src/sattlint/analyzers/reset_contamination/_reset_path_collection.py +176 -0
- sattlint-1.0.0/src/sattlint/analyzers/reset_contamination/_reset_path_collection_sequence.py +281 -0
- sattlint-1.0.0/src/sattlint/analyzers/reset_contamination/_reset_path_condition.py +166 -0
- sattlint-1.0.0/src/sattlint/analyzers/reset_contamination/_reset_path_state.py +234 -0
- sattlint-1.0.0/src/sattlint/analyzers/reset_contamination/_reset_path_stmt_handlers.py +508 -0
- sattlint-1.0.0/src/sattlint/analyzers/reset_contamination/_reset_path_writes.py +91 -0
- sattlint-1.0.0/src/sattlint/analyzers/resource_usage.py +192 -0
- sattlint-1.0.0/src/sattlint/analyzers/rule_profiles.py +399 -0
- sattlint-1.0.0/src/sattlint/analyzers/safety_paths.py +132 -0
- sattlint-1.0.0/src/sattlint/analyzers/same_cycle.py +898 -0
- sattlint-1.0.0/src/sattlint/analyzers/sattline_builtins/__init__.py +45 -0
- sattlint-1.0.0/src/sattlint/analyzers/sattline_builtins/_sattline_builtin_types.py +25 -0
- sattlint-1.0.0/src/sattlint/analyzers/sattline_builtins/_sattline_builtins_part1.py +453 -0
- sattlint-1.0.0/src/sattlint/analyzers/sattline_builtins/_sattline_builtins_part2.py +434 -0
- sattlint-1.0.0/src/sattlint/analyzers/sattline_builtins/_sattline_builtins_part3.py +425 -0
- sattlint-1.0.0/src/sattlint/analyzers/sattline_builtins/_sattline_builtins_part4.py +405 -0
- sattlint-1.0.0/src/sattlint/analyzers/sattline_builtins/_sattline_builtins_part5.py +368 -0
- sattlint-1.0.0/src/sattlint/analyzers/sattline_builtins/_sattline_builtins_registry.py +22 -0
- sattlint-1.0.0/src/sattlint/analyzers/sattline_semantics.py +177 -0
- sattlint-1.0.0/src/sattlint/analyzers/scan_concurrency.py +44 -0
- sattlint-1.0.0/src/sattlint/analyzers/scan_loop_resource_usage.py +247 -0
- sattlint-1.0.0/src/sattlint/analyzers/scan_shared_access.py +44 -0
- sattlint-1.0.0/src/sattlint/analyzers/sfc/__init__.py +505 -0
- sattlint-1.0.0/src/sattlint/analyzers/sfc/_sfc_collectors.py +272 -0
- sattlint-1.0.0/src/sattlint/analyzers/sfc/_sfc_guard_logic.py +409 -0
- sattlint-1.0.0/src/sattlint/analyzers/sfc/_sfc_module_walk.py +41 -0
- sattlint-1.0.0/src/sattlint/analyzers/sfc/_sfc_step_contracts.py +430 -0
- sattlint-1.0.0/src/sattlint/analyzers/shadowing.py +167 -0
- sattlint-1.0.0/src/sattlint/analyzers/shared/__init__.py +3 -0
- sattlint-1.0.0/src/sattlint/analyzers/shared/_array_builtins.py +56 -0
- sattlint-1.0.0/src/sattlint/analyzers/shared/_dedupe.py +20 -0
- sattlint-1.0.0/src/sattlint/analyzers/shared/_dependency_usage_facts.py +544 -0
- sattlint-1.0.0/src/sattlint/analyzers/shared/_report_defaults.py +21 -0
- sattlint-1.0.0/src/sattlint/analyzers/shared/_validators.py +458 -0
- sattlint-1.0.0/src/sattlint/analyzers/shared/_walk_utils.py +94 -0
- sattlint-1.0.0/src/sattlint/analyzers/shared/ast_node_helpers.py +111 -0
- sattlint-1.0.0/src/sattlint/analyzers/shared/variable_utils.py +123 -0
- sattlint-1.0.0/src/sattlint/analyzers/signal_lifecycle.py +317 -0
- sattlint-1.0.0/src/sattlint/analyzers/spec_compliance.py +491 -0
- sattlint-1.0.0/src/sattlint/analyzers/state_inference.py +137 -0
- sattlint-1.0.0/src/sattlint/analyzers/string_inference.py +1716 -0
- sattlint-1.0.0/src/sattlint/analyzers/symbolic_lite.py +110 -0
- sattlint-1.0.0/src/sattlint/analyzers/taint_paths.py +144 -0
- sattlint-1.0.0/src/sattlint/analyzers/timing.py +75 -0
- sattlint-1.0.0/src/sattlint/analyzers/unsafe_defaults.py +140 -0
- sattlint-1.0.0/src/sattlint/analyzers/variable_analyses.py +75 -0
- sattlint-1.0.0/src/sattlint/analyzers/variable_usage_reporting.py +466 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/__init__.py +433 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_usage_tracker.py +79 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variable_issue_collection.py +648 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variable_module_issue_scan.py +196 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variable_traversal.py +193 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variable_traversal_objects.py +162 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variable_traversal_support.py +841 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variable_traversal_walk.py +364 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_access.py +703 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_analyzer_facade.py +213 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_contracts.py +806 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_effect_flow.py +509 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_effect_sources.py +193 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_execution.py +933 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_facade_properties.py +164 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_mapping_refs.py +38 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_picture_display_support.py +393 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_status.py +409 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_string_overflow.py +73 -0
- sattlint-1.0.0/src/sattlint/analyzers/variables/_variables_submodules.py +616 -0
- sattlint-1.0.0/src/sattlint/app.py +344 -0
- sattlint-1.0.0/src/sattlint/application/__init__.py +17 -0
- sattlint-1.0.0/src/sattlint/application/analyze.py +119 -0
- sattlint-1.0.0/src/sattlint/application/checks.py +572 -0
- sattlint-1.0.0/src/sattlint/application/commands.py +438 -0
- sattlint-1.0.0/src/sattlint/application/findings.py +129 -0
- sattlint-1.0.0/src/sattlint/application/output.py +47 -0
- sattlint-1.0.0/src/sattlint/application/project.py +245 -0
- sattlint-1.0.0/src/sattlint/application/service.py +188 -0
- sattlint-1.0.0/src/sattlint/cache/__init__.py +402 -0
- sattlint-1.0.0/src/sattlint/cache/classes.py +450 -0
- sattlint-1.0.0/src/sattlint/cache/manager.py +202 -0
- sattlint-1.0.0/src/sattlint/cli/__init__.py +3 -0
- sattlint-1.0.0/src/sattlint/cli/_exit_codes.py +7 -0
- sattlint-1.0.0/src/sattlint/cli/_interaction.py +93 -0
- sattlint-1.0.0/src/sattlint/cli/app_cli_commands.py +187 -0
- sattlint-1.0.0/src/sattlint/cli/app_commands.py +149 -0
- sattlint-1.0.0/src/sattlint/cli/cli_output.py +45 -0
- sattlint-1.0.0/src/sattlint/cli/command_handlers.py +49 -0
- sattlint-1.0.0/src/sattlint/cli/config.py +19 -0
- sattlint-1.0.0/src/sattlint/cli/entry.py +426 -0
- sattlint-1.0.0/src/sattlint/cli/interaction.py +66 -0
- sattlint-1.0.0/src/sattlint/cli/menu.py +108 -0
- sattlint-1.0.0/src/sattlint/cli/rich_output.py +41 -0
- sattlint-1.0.0/src/sattlint/cli/startup.py +402 -0
- sattlint-1.0.0/src/sattlint/cli/syntax_check.py +112 -0
- sattlint-1.0.0/src/sattlint/config/__init__.py +60 -0
- sattlint-1.0.0/src/sattlint/config/_self_check.py +98 -0
- sattlint-1.0.0/src/sattlint/config/defaults.py +126 -0
- sattlint-1.0.0/src/sattlint/config/display.py +128 -0
- sattlint-1.0.0/src/sattlint/config/io.py +118 -0
- sattlint-1.0.0/src/sattlint/config/paths.py +38 -0
- sattlint-1.0.0/src/sattlint/config/types.py +164 -0
- sattlint-1.0.0/src/sattlint/config/validation.py +512 -0
- sattlint-1.0.0/src/sattlint/console.py +179 -0
- sattlint-1.0.0/src/sattlint/core/__init__.py +32 -0
- sattlint-1.0.0/src/sattlint/core/_semantic_helpers.py +223 -0
- sattlint-1.0.0/src/sattlint/core/_semantic_index.py +293 -0
- sattlint-1.0.0/src/sattlint/core/_semantic_index_reference_support.py +334 -0
- sattlint-1.0.0/src/sattlint/core/_semantic_snapshot.py +603 -0
- sattlint-1.0.0/src/sattlint/core/ast_tools.py +129 -0
- sattlint-1.0.0/src/sattlint/core/call_signatures.py +87 -0
- sattlint-1.0.0/src/sattlint/core/debug.py +20 -0
- sattlint-1.0.0/src/sattlint/core/diagnostics.py +428 -0
- sattlint-1.0.0/src/sattlint/core/document.py +68 -0
- sattlint-1.0.0/src/sattlint/core/interaction.py +51 -0
- sattlint-1.0.0/src/sattlint/core/logging.py +26 -0
- sattlint-1.0.0/src/sattlint/core/profiling.py +188 -0
- sattlint-1.0.0/src/sattlint/core/safety_paths.py +131 -0
- sattlint-1.0.0/src/sattlint/core/semantic.py +337 -0
- sattlint-1.0.0/src/sattlint/core/semantic_analysis.py +141 -0
- sattlint-1.0.0/src/sattlint/core/syntax.py +401 -0
- sattlint-1.0.0/src/sattlint/core/taint_paths.py +217 -0
- sattlint-1.0.0/src/sattlint/core/terminal.py +160 -0
- sattlint-1.0.0/src/sattlint/core/tracing.py +116 -0
- sattlint-1.0.0/src/sattlint/core/workspace_discovery.py +319 -0
- sattlint-1.0.0/src/sattlint/engine.py +245 -0
- sattlint-1.0.0/src/sattlint/engine_fuzzer.py +20 -0
- sattlint-1.0.0/src/sattlint/grammar/constants.py +13 -0
- sattlint-1.0.0/src/sattlint/graphics/__init__.py +1 -0
- sattlint-1.0.0/src/sattlint/graphics/graphics_context_helpers.py +118 -0
- sattlint-1.0.0/src/sattlint/graphics/graphics_helpers.py +275 -0
- sattlint-1.0.0/src/sattlint/graphics/picture_display_paths.py +491 -0
- sattlint-1.0.0/src/sattlint/graphics/picture_display_runtime.py +516 -0
- sattlint-1.0.0/src/sattlint/graphics/picture_display_runtime_helpers.py +266 -0
- sattlint-1.0.0/src/sattlint/graphics/validation.py +350 -0
- sattlint-1.0.0/src/sattlint/graphics/validation_bindings.py +296 -0
- sattlint-1.0.0/src/sattlint/icf_fuzzer.py +24 -0
- sattlint-1.0.0/src/sattlint/models/__init__.py +6 -0
- sattlint-1.0.0/src/sattlint/models/_validation_notice.py +18 -0
- sattlint-1.0.0/src/sattlint/models/_variable_issues.py +243 -0
- sattlint-1.0.0/src/sattlint/models/ast_model.py +67 -0
- sattlint-1.0.0/src/sattlint/models/project_graph.py +210 -0
- sattlint-1.0.0/src/sattlint/models/usage.py +98 -0
- sattlint-1.0.0/src/sattlint/project/__init__.py +28 -0
- sattlint-1.0.0/src/sattlint/project/cache.py +102 -0
- sattlint-1.0.0/src/sattlint/project/io.py +162 -0
- sattlint-1.0.0/src/sattlint/project/loader.py +240 -0
- sattlint-1.0.0/src/sattlint/project/loader_base.py +189 -0
- sattlint-1.0.0/src/sattlint/project/loader_config.py +251 -0
- sattlint-1.0.0/src/sattlint/project/loader_lookup.py +567 -0
- sattlint-1.0.0/src/sattlint/project/loading.py +539 -0
- sattlint-1.0.0/src/sattlint/project/loading_support.py +359 -0
- sattlint-1.0.0/src/sattlint/project/models.py +77 -0
- sattlint-1.0.0/src/sattlint/project/support.py +284 -0
- sattlint-1.0.0/src/sattlint/project/types.py +40 -0
- sattlint-1.0.0/src/sattlint/reporting/__init__.py +18 -0
- sattlint-1.0.0/src/sattlint/reporting/_variables_report_rendering.py +496 -0
- sattlint-1.0.0/src/sattlint/reporting/comment_code_report.py +105 -0
- sattlint-1.0.0/src/sattlint/reporting/corpus_diff.py +68 -0
- sattlint-1.0.0/src/sattlint/reporting/icf_report.py +235 -0
- sattlint-1.0.0/src/sattlint/reporting/mms_report.py +166 -0
- sattlint-1.0.0/src/sattlint/reporting/target_report.py +125 -0
- sattlint-1.0.0/src/sattlint/reporting/variables_report.py +437 -0
- sattlint-1.0.0/src/sattlint/resolution/__init__.py +22 -0
- sattlint-1.0.0/src/sattlint/resolution/_alias_utils.py +106 -0
- sattlint-1.0.0/src/sattlint/resolution/_builtin_datatypes.py +29 -0
- sattlint-1.0.0/src/sattlint/resolution/_builtin_datatypes_part1.py +465 -0
- sattlint-1.0.0/src/sattlint/resolution/_builtin_datatypes_part2.py +267 -0
- sattlint-1.0.0/src/sattlint/resolution/_builtin_datatypes_part3.py +101 -0
- sattlint-1.0.0/src/sattlint/resolution/_builtin_datatypes_shared.py +139 -0
- sattlint-1.0.0/src/sattlint/resolution/_moduletype_resolution.py +283 -0
- sattlint-1.0.0/src/sattlint/resolution/access_graph.py +42 -0
- sattlint-1.0.0/src/sattlint/resolution/common.py +82 -0
- sattlint-1.0.0/src/sattlint/resolution/context_builder.py +447 -0
- sattlint-1.0.0/src/sattlint/resolution/dependency_versions.py +74 -0
- sattlint-1.0.0/src/sattlint/resolution/paths.py +84 -0
- sattlint-1.0.0/src/sattlint/resolution/scope.py +124 -0
- sattlint-1.0.0/src/sattlint/resolution/symbol_table.py +54 -0
- sattlint-1.0.0/src/sattlint/resolution/type_graph.py +158 -0
- sattlint-1.0.0/src/sattlint/runs/__init__.py +27 -0
- sattlint-1.0.0/src/sattlint/runs/io.py +119 -0
- sattlint-1.0.0/src/sattlint/runs/types.py +264 -0
- sattlint-1.0.0/src/sattlint/syntax_fuzzer.py +24 -0
- sattlint-1.0.0/src/sattlint/transformer/__init__.py +3 -0
- sattlint-1.0.0/src/sattlint/transformer/sl_transformer.py +9 -0
- sattlint-1.0.0/src/sattlint/types.py +18 -0
- sattlint-1.0.0/src/sattlint/ui/__init__.py +35 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_actions.py +1197 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_analyze.py +484 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_app.py +413 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_results.py +259 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_settings.py +198 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_setup.py +245 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_setup_actions.py +157 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_setup_display.py +261 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_setup_targets.py +408 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_shared.py +460 -0
- sattlint-1.0.0/src/sattlint/ui/_app_textual_widgets.py +601 -0
- sattlint-1.0.0/src/sattlint/ui/app_textual.py +28 -0
- sattlint-1.0.0/src/sattlint/utils/__init__.py +3 -0
- sattlint-1.0.0/src/sattlint/utils/_comment_scanning.py +472 -0
- sattlint-1.0.0/src/sattlint/utils/casefolding.py +32 -0
- sattlint-1.0.0/src/sattlint/utils/repo_paths.py +26 -0
- sattlint-1.0.0/src/sattlint/utils/text_processing.py +330 -0
- sattlint-1.0.0/src/sattlint/validation/__init__.py +351 -0
- sattlint-1.0.0/src/sattlint/validation/expression.py +688 -0
- sattlint-1.0.0/src/sattlint/validation/sequences.py +735 -0
- sattlint-1.0.0/src/sattlint/validation/shared.py +103 -0
- sattlint-1.0.0/src/sattlint/validation/structure_core.py +464 -0
- sattlint-1.0.0/src/sattlint/validation/structure_modules.py +194 -0
- sattlint-1.0.0/src/sattlint/validation/type_helpers.py +405 -0
- sattlint-1.0.0/src/sattlint.egg-info/PKG-INFO +275 -0
- sattlint-1.0.0/src/sattlint.egg-info/SOURCES.txt +284 -0
- sattlint-1.0.0/src/sattlint.egg-info/dependency_links.txt +1 -0
- sattlint-1.0.0/src/sattlint.egg-info/entry_points.txt +2 -0
- sattlint-1.0.0/src/sattlint.egg-info/requires.txt +18 -0
- sattlint-1.0.0/src/sattlint.egg-info/top_level.txt +1 -0
- sattlint-1.0.0/tests/test_dependency_guard.py +119 -0
sattlint-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Søren H. Johansen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sattlint-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sattlint
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Static analysis, validation, and tooling for SattLine projects
|
|
5
|
+
Author: Søren H. Johansen
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/SorenHJohansen/SattLint
|
|
8
|
+
Project-URL: Repository, https://github.com/SorenHJohansen/SattLint
|
|
9
|
+
Project-URL: Issues, https://github.com/SorenHJohansen/SattLint/issues
|
|
10
|
+
Project-URL: Documentation, https://docs.sattlint.dev
|
|
11
|
+
Project-URL: Support, https://github.com/SorenHJohansen/SattLint/blob/main/SUPPORT.md
|
|
12
|
+
Project-URL: Changelog, https://github.com/SorenHJohansen/SattLint/blob/main/CHANGELOG.md
|
|
13
|
+
Project-URL: Security, https://github.com/SorenHJohansen/SattLint/security/policy
|
|
14
|
+
Keywords: sattline,static-analysis,plc
|
|
15
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
+
Classifier: Environment :: Console
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
22
|
+
Classifier: Topic :: Software Development :: Testing
|
|
23
|
+
Requires-Python: >=3.13
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: lark<2,>=1.3.1
|
|
27
|
+
Requires-Dist: sattline-parser<2027,>=2026.9.1
|
|
28
|
+
Requires-Dist: tomli_w>=1.2.0
|
|
29
|
+
Requires-Dist: rich>=13.9.0
|
|
30
|
+
Requires-Dist: textual<9,>=8.2.7
|
|
31
|
+
Provides-Extra: test
|
|
32
|
+
Requires-Dist: pytest>=7.0.0; extra == "test"
|
|
33
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
|
|
34
|
+
Requires-Dist: pytest-timeout>=2.3.1; extra == "test"
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: sattlint[test]; extra == "dev"
|
|
37
|
+
Requires-Dist: ruff==0.16.5; extra == "dev"
|
|
38
|
+
Requires-Dist: pyright>=1.1.411; extra == "dev"
|
|
39
|
+
Requires-Dist: build>=1.2.2; extra == "dev"
|
|
40
|
+
Requires-Dist: twine>=5.1.1; extra == "dev"
|
|
41
|
+
Requires-Dist: pre-commit>=4.0; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# SattLint
|
|
45
|
+
|
|
46
|
+
[](https://securityscorecards.dev/viewer/?uri=github.com/SorenHJohansen/SattLint)
|
|
47
|
+
|
|
48
|
+
SattLint is a Python toolkit for SattLine projects. It provides syntax-checking, configurable static analysis, ICF validation and formatting, graphics-rule analysis, and an interactive terminal UI.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## What SattLint Does
|
|
53
|
+
|
|
54
|
+
- Check whether a SattLine file parses correctly
|
|
55
|
+
- Analyze a full program or library together with its dependencies
|
|
56
|
+
- Find issues such as unused variables, written-but-never-read variables, and shadowing
|
|
57
|
+
- Validate and format ICF files and check graphics rules
|
|
58
|
+
- Inspect parser outputs when something looks wrong
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Requirements
|
|
63
|
+
|
|
64
|
+
- **Windows** or **Linux**
|
|
65
|
+
- **Python 3.13 or newer**
|
|
66
|
+
- **pipx** (for clean, isolated installation)
|
|
67
|
+
- A local copy of your SattLine code
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
### 1. Get the source
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git clone https://github.com/SorenHJohansen/SattLint.git
|
|
77
|
+
cd SattLint
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 2. Install pipx
|
|
81
|
+
|
|
82
|
+
#### Linux
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
python3 -m pip install --user pipx
|
|
86
|
+
python3 -m pipx ensurepath
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Restart your terminal after this.
|
|
90
|
+
|
|
91
|
+
#### Windows
|
|
92
|
+
|
|
93
|
+
```powershell
|
|
94
|
+
py -m pip install --user pipx
|
|
95
|
+
py -m pipx ensurepath
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Restart your terminal after this.
|
|
99
|
+
|
|
100
|
+
### 3. Install SattLint
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pipx install .
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This installs SattLint globally in an isolated environment.
|
|
107
|
+
|
|
108
|
+
### 4. Verify
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
sattlint --version
|
|
112
|
+
sattlint syntax-check tests/fixtures/sample_sattline_files/SattLineFullGrammarTest.s
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Quick Start
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
sattlint syntax-check path/to/Program.s
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Output:
|
|
124
|
+
|
|
125
|
+
- `OK` — valid file
|
|
126
|
+
- Error message — invalid file
|
|
127
|
+
|
|
128
|
+
Exit codes:
|
|
129
|
+
|
|
130
|
+
- `0` — success
|
|
131
|
+
- `1` — a real problem was found (e.g. `syntax-check` found a syntax error)
|
|
132
|
+
- `2` — invalid arguments or configuration
|
|
133
|
+
|
|
134
|
+
`analyze` reports issues in its output but exits `0` once the analysis runs;
|
|
135
|
+
among the CLI commands, only `syntax-check` uses exit code `1` for findings.
|
|
136
|
+
|
|
137
|
+
### Available Commands
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
sattlint syntax-check path/to/Program.s
|
|
141
|
+
sattlint init # scaffold a .slproj project file
|
|
142
|
+
sattlint analyze --list-checks # list available analyzers
|
|
143
|
+
sattlint analyze --check naming-consistency
|
|
144
|
+
sattlint validate-config
|
|
145
|
+
sattlint cache-prune
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Shared flags for config-driven commands:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
sattlint --config path/to/config.toml analyze --check naming-consistency
|
|
152
|
+
sattlint --config path/to/config.toml --no-cache analyze --check naming-consistency
|
|
153
|
+
sattlint --project path/to/project.slproj analyze --check naming-consistency
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
For the full command reference, run `sattlint --help`.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Interactive Shell
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
sattlint
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Opens the Textual interactive terminal UI with the following views:
|
|
167
|
+
|
|
168
|
+
- **Analyze** — queue curated reports and additional analyzers
|
|
169
|
+
- **Setup** — configure paths, targets, mode, and cache settings
|
|
170
|
+
- **Help** — first-time guidance and workflow explanation
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Project Files (.slproj)
|
|
175
|
+
|
|
176
|
+
A `.slproj` project file captures all analysis settings in a single
|
|
177
|
+
checked-in file: targets, directories, mode, and output/cache paths. Paths
|
|
178
|
+
inside a `.slproj` are relative to the file itself, so projects are portable
|
|
179
|
+
across machines.
|
|
180
|
+
|
|
181
|
+
- `sattlint init` scaffolds a new `.slproj` in the current directory.
|
|
182
|
+
- `sattlint --project PATH <command>` uses an explicit project file.
|
|
183
|
+
- Without `--project` or `--config`, SattLint auto-discovers a `.slproj` by
|
|
184
|
+
walking up from the current working directory.
|
|
185
|
+
- Project settings merge over `~/.config/sattlint/config.toml` defaults.
|
|
186
|
+
|
|
187
|
+
Prefer a `.slproj` project file over editing `~/.config/sattlint/config.toml`
|
|
188
|
+
directly.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## First-Time Setup
|
|
193
|
+
|
|
194
|
+
The first time SattLint runs, it creates a config file automatically:
|
|
195
|
+
|
|
196
|
+
- **Windows:** `%APPDATA%\sattlint\config.toml`
|
|
197
|
+
- **Linux:** `~/.config/sattlint/config.toml`
|
|
198
|
+
|
|
199
|
+
For a portable, checked-in setup, create a `.slproj` project file with
|
|
200
|
+
`sattlint init` instead; project settings merge over these config defaults
|
|
201
|
+
(see [Project Files](#project-files-slproj)).
|
|
202
|
+
|
|
203
|
+
### Configuration
|
|
204
|
+
|
|
205
|
+
1. Start SattLint with `sattlint`
|
|
206
|
+
2. Select **Setup**
|
|
207
|
+
3. Configure the following:
|
|
208
|
+
|
|
209
|
+
- `program_dir` — your SattLine program folder
|
|
210
|
+
- `ABB_lib_dir` — shared or ABB libraries
|
|
211
|
+
- `other_lib_dirs` — any additional libraries
|
|
212
|
+
- `analyzed_programs_and_libraries` — what to analyze
|
|
213
|
+
- `icf_dir` — directory used for ICF validation and formatting
|
|
214
|
+
- `Edit graphics rules` — define expected module invocation or clipping rules (saved as JSON)
|
|
215
|
+
|
|
216
|
+
4. Save with **Save configuration**
|
|
217
|
+
5. Select **Analyze** to run checks
|
|
218
|
+
|
|
219
|
+
> **Note:** Use names without file extensions (e.g. `MyProgram`, not `MyProgram.s`).
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Updating
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
pipx install --force .
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Graphics Rule Configuration
|
|
232
|
+
|
|
233
|
+
1. Open **Setup**, then **Edit graphics rules** to add or update expected invocation coordinates, flags, and clipping-related values
|
|
234
|
+
2. Use `unit:` selectors when a module should look the same in every detected unit (e.g. `unit:L1` or `unit:L1.L2.UnitControl`)
|
|
235
|
+
3. Use `equipment:` selectors when a module should look the same inside every equipment module (e.g. `equipment:L1.L2.EquipModPanelShort`)
|
|
236
|
+
4. Open **Analyze**, then run **Validate graphics rules** from **Structure & modules** to report modules that are not to spec
|
|
237
|
+
5. Run `sattlint validate-config` to confirm the graphics rules JSON path is valid
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Common Problems
|
|
242
|
+
|
|
243
|
+
### `sattlint` not found
|
|
244
|
+
|
|
245
|
+
pipx is not on your PATH. Run `pipx ensurepath` and restart your terminal.
|
|
246
|
+
|
|
247
|
+
### Python version error
|
|
248
|
+
|
|
249
|
+
Install Python 3.13+ and reinstall with `pipx install --force .`.
|
|
250
|
+
|
|
251
|
+
### Targets not found
|
|
252
|
+
|
|
253
|
+
- Names must not include file extensions
|
|
254
|
+
- Paths in config must be correct
|
|
255
|
+
- Mode (`official` / `draft`) must match your files
|
|
256
|
+
|
|
257
|
+
### Missing libraries
|
|
258
|
+
|
|
259
|
+
Add missing folders to `ABB_lib_dir` or `other_lib_dirs`.
|
|
260
|
+
|
|
261
|
+
### Results look outdated
|
|
262
|
+
|
|
263
|
+
Use `sattlint --no-cache analyze` to skip the AST cache, or run `sattlint cache-prune` to remove stale cache artifacts before re-analyzing.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## For Developers
|
|
268
|
+
|
|
269
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, tests, and tooling.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## License
|
|
274
|
+
|
|
275
|
+
SattLint is released under the MIT License.
|
sattlint-1.0.0/README.md
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# SattLint
|
|
2
|
+
|
|
3
|
+
[](https://securityscorecards.dev/viewer/?uri=github.com/SorenHJohansen/SattLint)
|
|
4
|
+
|
|
5
|
+
SattLint is a Python toolkit for SattLine projects. It provides syntax-checking, configurable static analysis, ICF validation and formatting, graphics-rule analysis, and an interactive terminal UI.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What SattLint Does
|
|
10
|
+
|
|
11
|
+
- Check whether a SattLine file parses correctly
|
|
12
|
+
- Analyze a full program or library together with its dependencies
|
|
13
|
+
- Find issues such as unused variables, written-but-never-read variables, and shadowing
|
|
14
|
+
- Validate and format ICF files and check graphics rules
|
|
15
|
+
- Inspect parser outputs when something looks wrong
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Requirements
|
|
20
|
+
|
|
21
|
+
- **Windows** or **Linux**
|
|
22
|
+
- **Python 3.13 or newer**
|
|
23
|
+
- **pipx** (for clean, isolated installation)
|
|
24
|
+
- A local copy of your SattLine code
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
### 1. Get the source
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/SorenHJohansen/SattLint.git
|
|
34
|
+
cd SattLint
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Install pipx
|
|
38
|
+
|
|
39
|
+
#### Linux
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
python3 -m pip install --user pipx
|
|
43
|
+
python3 -m pipx ensurepath
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Restart your terminal after this.
|
|
47
|
+
|
|
48
|
+
#### Windows
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
py -m pip install --user pipx
|
|
52
|
+
py -m pipx ensurepath
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Restart your terminal after this.
|
|
56
|
+
|
|
57
|
+
### 3. Install SattLint
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pipx install .
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This installs SattLint globally in an isolated environment.
|
|
64
|
+
|
|
65
|
+
### 4. Verify
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
sattlint --version
|
|
69
|
+
sattlint syntax-check tests/fixtures/sample_sattline_files/SattLineFullGrammarTest.s
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Quick Start
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
sattlint syntax-check path/to/Program.s
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Output:
|
|
81
|
+
|
|
82
|
+
- `OK` — valid file
|
|
83
|
+
- Error message — invalid file
|
|
84
|
+
|
|
85
|
+
Exit codes:
|
|
86
|
+
|
|
87
|
+
- `0` — success
|
|
88
|
+
- `1` — a real problem was found (e.g. `syntax-check` found a syntax error)
|
|
89
|
+
- `2` — invalid arguments or configuration
|
|
90
|
+
|
|
91
|
+
`analyze` reports issues in its output but exits `0` once the analysis runs;
|
|
92
|
+
among the CLI commands, only `syntax-check` uses exit code `1` for findings.
|
|
93
|
+
|
|
94
|
+
### Available Commands
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
sattlint syntax-check path/to/Program.s
|
|
98
|
+
sattlint init # scaffold a .slproj project file
|
|
99
|
+
sattlint analyze --list-checks # list available analyzers
|
|
100
|
+
sattlint analyze --check naming-consistency
|
|
101
|
+
sattlint validate-config
|
|
102
|
+
sattlint cache-prune
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Shared flags for config-driven commands:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
sattlint --config path/to/config.toml analyze --check naming-consistency
|
|
109
|
+
sattlint --config path/to/config.toml --no-cache analyze --check naming-consistency
|
|
110
|
+
sattlint --project path/to/project.slproj analyze --check naming-consistency
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
For the full command reference, run `sattlint --help`.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Interactive Shell
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
sattlint
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Opens the Textual interactive terminal UI with the following views:
|
|
124
|
+
|
|
125
|
+
- **Analyze** — queue curated reports and additional analyzers
|
|
126
|
+
- **Setup** — configure paths, targets, mode, and cache settings
|
|
127
|
+
- **Help** — first-time guidance and workflow explanation
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Project Files (.slproj)
|
|
132
|
+
|
|
133
|
+
A `.slproj` project file captures all analysis settings in a single
|
|
134
|
+
checked-in file: targets, directories, mode, and output/cache paths. Paths
|
|
135
|
+
inside a `.slproj` are relative to the file itself, so projects are portable
|
|
136
|
+
across machines.
|
|
137
|
+
|
|
138
|
+
- `sattlint init` scaffolds a new `.slproj` in the current directory.
|
|
139
|
+
- `sattlint --project PATH <command>` uses an explicit project file.
|
|
140
|
+
- Without `--project` or `--config`, SattLint auto-discovers a `.slproj` by
|
|
141
|
+
walking up from the current working directory.
|
|
142
|
+
- Project settings merge over `~/.config/sattlint/config.toml` defaults.
|
|
143
|
+
|
|
144
|
+
Prefer a `.slproj` project file over editing `~/.config/sattlint/config.toml`
|
|
145
|
+
directly.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## First-Time Setup
|
|
150
|
+
|
|
151
|
+
The first time SattLint runs, it creates a config file automatically:
|
|
152
|
+
|
|
153
|
+
- **Windows:** `%APPDATA%\sattlint\config.toml`
|
|
154
|
+
- **Linux:** `~/.config/sattlint/config.toml`
|
|
155
|
+
|
|
156
|
+
For a portable, checked-in setup, create a `.slproj` project file with
|
|
157
|
+
`sattlint init` instead; project settings merge over these config defaults
|
|
158
|
+
(see [Project Files](#project-files-slproj)).
|
|
159
|
+
|
|
160
|
+
### Configuration
|
|
161
|
+
|
|
162
|
+
1. Start SattLint with `sattlint`
|
|
163
|
+
2. Select **Setup**
|
|
164
|
+
3. Configure the following:
|
|
165
|
+
|
|
166
|
+
- `program_dir` — your SattLine program folder
|
|
167
|
+
- `ABB_lib_dir` — shared or ABB libraries
|
|
168
|
+
- `other_lib_dirs` — any additional libraries
|
|
169
|
+
- `analyzed_programs_and_libraries` — what to analyze
|
|
170
|
+
- `icf_dir` — directory used for ICF validation and formatting
|
|
171
|
+
- `Edit graphics rules` — define expected module invocation or clipping rules (saved as JSON)
|
|
172
|
+
|
|
173
|
+
4. Save with **Save configuration**
|
|
174
|
+
5. Select **Analyze** to run checks
|
|
175
|
+
|
|
176
|
+
> **Note:** Use names without file extensions (e.g. `MyProgram`, not `MyProgram.s`).
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Updating
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
pipx install --force .
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Graphics Rule Configuration
|
|
189
|
+
|
|
190
|
+
1. Open **Setup**, then **Edit graphics rules** to add or update expected invocation coordinates, flags, and clipping-related values
|
|
191
|
+
2. Use `unit:` selectors when a module should look the same in every detected unit (e.g. `unit:L1` or `unit:L1.L2.UnitControl`)
|
|
192
|
+
3. Use `equipment:` selectors when a module should look the same inside every equipment module (e.g. `equipment:L1.L2.EquipModPanelShort`)
|
|
193
|
+
4. Open **Analyze**, then run **Validate graphics rules** from **Structure & modules** to report modules that are not to spec
|
|
194
|
+
5. Run `sattlint validate-config` to confirm the graphics rules JSON path is valid
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Common Problems
|
|
199
|
+
|
|
200
|
+
### `sattlint` not found
|
|
201
|
+
|
|
202
|
+
pipx is not on your PATH. Run `pipx ensurepath` and restart your terminal.
|
|
203
|
+
|
|
204
|
+
### Python version error
|
|
205
|
+
|
|
206
|
+
Install Python 3.13+ and reinstall with `pipx install --force .`.
|
|
207
|
+
|
|
208
|
+
### Targets not found
|
|
209
|
+
|
|
210
|
+
- Names must not include file extensions
|
|
211
|
+
- Paths in config must be correct
|
|
212
|
+
- Mode (`official` / `draft`) must match your files
|
|
213
|
+
|
|
214
|
+
### Missing libraries
|
|
215
|
+
|
|
216
|
+
Add missing folders to `ABB_lib_dir` or `other_lib_dirs`.
|
|
217
|
+
|
|
218
|
+
### Results look outdated
|
|
219
|
+
|
|
220
|
+
Use `sattlint --no-cache analyze` to skip the AST cache, or run `sattlint cache-prune` to remove stale cache artifacts before re-analyzing.
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## For Developers
|
|
225
|
+
|
|
226
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, tests, and tooling.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
SattLint is released under the MIT License.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=82.0.1", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sattlint"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Static analysis, validation, and tooling for SattLine projects"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
authors = [{ name = "S\u00f8ren H. Johansen" }]
|
|
13
|
+
requires-python = ">=3.13"
|
|
14
|
+
keywords = ["sattline", "static-analysis", "plc"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 5 - Production/Stable",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
23
|
+
"Topic :: Software Development :: Testing",
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"lark>=1.3.1,<2",
|
|
27
|
+
"sattline-parser>=2026.9.1,<2027",
|
|
28
|
+
"tomli_w>=1.2.0",
|
|
29
|
+
"rich>=13.9.0",
|
|
30
|
+
"textual>=8.2.7,<9",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://github.com/SorenHJohansen/SattLint"
|
|
35
|
+
Repository = "https://github.com/SorenHJohansen/SattLint"
|
|
36
|
+
Issues = "https://github.com/SorenHJohansen/SattLint/issues"
|
|
37
|
+
Documentation = "https://docs.sattlint.dev"
|
|
38
|
+
Support = "https://github.com/SorenHJohansen/SattLint/blob/main/SUPPORT.md"
|
|
39
|
+
Changelog = "https://github.com/SorenHJohansen/SattLint/blob/main/CHANGELOG.md"
|
|
40
|
+
Security = "https://github.com/SorenHJohansen/SattLint/security/policy"
|
|
41
|
+
|
|
42
|
+
[project.optional-dependencies]
|
|
43
|
+
test = [
|
|
44
|
+
"pytest>=7.0.0",
|
|
45
|
+
"pytest-cov>=4.0.0", # Coverage reporting
|
|
46
|
+
"pytest-timeout>=2.3.1", # Fail fast on stalled tests
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
dev = [
|
|
50
|
+
"sattlint[test]",
|
|
51
|
+
"ruff==0.16.5", # Match pre-commit Ruff to avoid formatter drift
|
|
52
|
+
"pyright>=1.1.411", # Type checking
|
|
53
|
+
"build>=1.2.2", # Build frontend for release validation
|
|
54
|
+
"twine>=5.1.1", # Package metadata validation
|
|
55
|
+
"pre-commit>=4.0", # Git hooks
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[tool.pytest.ini_options]
|
|
59
|
+
minversion = "7.0"
|
|
60
|
+
testpaths = ["tests"]
|
|
61
|
+
python_files = ["test_*.py", "*_test.py"]
|
|
62
|
+
python_classes = ["Test*"]
|
|
63
|
+
python_functions = ["test_*"]
|
|
64
|
+
timeout = 60
|
|
65
|
+
timeout_method = "thread"
|
|
66
|
+
addopts = [
|
|
67
|
+
"--strict-markers",
|
|
68
|
+
"--strict-config",
|
|
69
|
+
]
|
|
70
|
+
markers = [
|
|
71
|
+
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
72
|
+
"integration: marks tests as integration tests",
|
|
73
|
+
"unit: marks tests as unit tests",
|
|
74
|
+
"parser: marks tests related to parser functionality",
|
|
75
|
+
"analyzer: marks tests related to analyzer functionality",
|
|
76
|
+
"quarantine: marks flaky tests that should be skipped in CI",
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
[tool.coverage.report]
|
|
80
|
+
precision = 2
|
|
81
|
+
|
|
82
|
+
[project.scripts]
|
|
83
|
+
sattlint = "sattlint.cli.startup:cli"
|
|
84
|
+
|
|
85
|
+
[tool.ruff]
|
|
86
|
+
line-length = 120
|
|
87
|
+
target-version = "py313"
|
|
88
|
+
|
|
89
|
+
[tool.ruff.lint]
|
|
90
|
+
select = [
|
|
91
|
+
"E", # pycodestyle errors
|
|
92
|
+
"F", # pyflakes
|
|
93
|
+
"W", # pycodestyle warnings
|
|
94
|
+
"I", # isort
|
|
95
|
+
"N", # pep8-naming
|
|
96
|
+
"UP", # pyupgrade
|
|
97
|
+
"B", # flake8-bugarith
|
|
98
|
+
"BLE", # blind except Exception handlers
|
|
99
|
+
"C4", # flake8-comprehensions
|
|
100
|
+
"PLC0415", # imports outside top-level
|
|
101
|
+
"PLR0915", # too many statements
|
|
102
|
+
"S101", # disallow assert-based error handling
|
|
103
|
+
"SIM", # flake8-simplify
|
|
104
|
+
"RUF", # ruff-specific rules
|
|
105
|
+
]
|
|
106
|
+
ignore = [
|
|
107
|
+
"E501", # line too long (handled by formatter)
|
|
108
|
+
]
|
|
109
|
+
|
|
110
|
+
[tool.ruff.lint.per-file-ignores]
|
|
111
|
+
"tests/*.py" = ["S101", "F403", "F405"]
|
|
112
|
+
"tests/**/*.py" = ["S101", "F403", "F405"]
|
|
113
|
+
|
|
114
|
+
[tool.ruff.lint.pylint]
|
|
115
|
+
max-statements = 50
|
|
116
|
+
|
|
117
|
+
[tool.pyright]
|
|
118
|
+
include = ["src/sattlint"]
|
|
119
|
+
typeCheckingMode = "strict"
|
|
120
|
+
pythonVersion = "3.13"
|
|
121
|
+
venvPath = "."
|
|
122
|
+
venv = ".venv"
|
|
123
|
+
extraPaths = ["src"]
|
|
124
|
+
reportMissingTypeStubs = false
|
|
125
|
+
|
|
126
|
+
[tool.setuptools.packages.find]
|
|
127
|
+
where = ["src"]
|
|
128
|
+
|
|
129
|
+
[tool.setuptools.dynamic]
|
|
130
|
+
version = { attr = "sattlint.__version__.__version__" }
|
sattlint-1.0.0/setup.cfg
ADDED