@sun-asterisk/sunlint 1.3.33 → 1.3.35
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.
- package/config/released-rules.json +62 -0
- package/config/rules/enhanced-rules-registry.json +2315 -1354
- package/core/adapters/dart-analyzer.js +658 -0
- package/core/adapters/index.js +102 -0
- package/core/adapters/sunlint-rule-adapter.js +0 -2
- package/core/adapters/typescript-analyzer.js +277 -0
- package/core/analysis-orchestrator.js +168 -40
- package/core/architecture-integration.js +16 -7
- package/core/auto-performance-manager.js +1 -1
- package/core/cli-action-handler.js +98 -21
- package/core/cli-program.js +96 -138
- package/core/config-merger.js +24 -14
- package/core/constants/defaults.js +1 -2
- package/core/file-targeting-service.js +62 -4
- package/core/git-utils.js +19 -12
- package/core/github-annotate-service.js +456 -89
- package/core/github-step-summary-generator.js +8 -8
- package/core/html-report-generator.js +326 -731
- package/core/impact-integration.js +433 -0
- package/core/interfaces/language-analyzer.interface.js +393 -0
- package/core/output-service.js +308 -35
- package/core/rule-selection-service.js +77 -27
- package/core/scoring-service.js +3 -2
- package/core/semantic-engine-manager.js +375 -0
- package/core/semantic-engine.js +4 -57
- package/core/unified-rule-registry.js +52 -11
- package/docs/DART_RULE_EXECUTION_FLOW.md +745 -0
- package/docs/DART_SUPPORT_IMPLEMENTATION.md +245 -0
- package/docs/SUNLINT_ARCHITECTURE.md +692 -0
- package/docs/skills/CREATE_DART_RULE.md +909 -0
- package/engines/arch-detect/core/analyzer.js +413 -0
- package/engines/arch-detect/core/index.js +22 -0
- package/engines/arch-detect/engine/hybrid-detector.js +176 -0
- package/engines/arch-detect/engine/index.js +24 -0
- package/engines/arch-detect/engine/rule-executor.js +228 -0
- package/engines/arch-detect/engine/score-calculator.js +214 -0
- package/engines/arch-detect/engine/violation-detector.js +616 -0
- package/engines/arch-detect/index.js +50 -0
- package/engines/arch-detect/rules/base-rule.js +187 -0
- package/engines/arch-detect/rules/index.js +35 -0
- package/engines/arch-detect/rules/layered/index.js +28 -0
- package/engines/arch-detect/rules/layered/l001-presentation-layer.js +237 -0
- package/engines/arch-detect/rules/layered/l002-business-layer.js +215 -0
- package/engines/arch-detect/rules/layered/l003-data-layer.js +229 -0
- package/engines/arch-detect/rules/layered/l004-model-layer.js +204 -0
- package/engines/arch-detect/rules/layered/l005-layer-separation.js +215 -0
- package/engines/arch-detect/rules/layered/l006-dependency-direction.js +221 -0
- package/engines/arch-detect/rules/layered/layered-rules-collection.js +445 -0
- package/engines/arch-detect/rules/modular/index.js +27 -0
- package/engines/arch-detect/rules/modular/m001-feature-modules.js +238 -0
- package/engines/arch-detect/rules/modular/m002-core-module.js +169 -0
- package/engines/arch-detect/rules/modular/m003-module-declaration.js +186 -0
- package/engines/arch-detect/rules/modular/m004-public-api.js +171 -0
- package/engines/arch-detect/rules/modular/m005-no-deep-imports.js +220 -0
- package/engines/arch-detect/rules/modular/modular-rules-collection.js +357 -0
- package/engines/arch-detect/rules/presentation/index.js +27 -0
- package/engines/arch-detect/rules/presentation/pr001-view-layer.js +221 -0
- package/engines/arch-detect/rules/presentation/pr002-presentation-logic.js +192 -0
- package/engines/arch-detect/rules/presentation/pr004-data-binding.js +187 -0
- package/engines/arch-detect/rules/presentation/pr006-router-layer.js +185 -0
- package/engines/arch-detect/rules/presentation/pr007-interactor-layer.js +181 -0
- package/engines/arch-detect/rules/presentation/presentation-rules-collection.js +507 -0
- package/engines/arch-detect/rules/project-scanner/index.js +31 -0
- package/engines/arch-detect/rules/project-scanner/ps001-project-root.js +213 -0
- package/engines/arch-detect/rules/project-scanner/ps002-language-detection.js +192 -0
- package/engines/arch-detect/rules/project-scanner/ps003-framework-detection.js +339 -0
- package/engines/arch-detect/rules/project-scanner/ps004-build-system.js +171 -0
- package/engines/arch-detect/rules/project-scanner/ps005-source-directory.js +163 -0
- package/engines/arch-detect/rules/project-scanner/ps006-test-directory.js +184 -0
- package/engines/arch-detect/rules/project-scanner/ps007-documentation.js +149 -0
- package/engines/arch-detect/rules/project-scanner/ps008-cicd-detection.js +163 -0
- package/engines/arch-detect/rules/project-scanner/ps009-code-quality.js +152 -0
- package/engines/arch-detect/rules/project-scanner/ps010-statistics.js +180 -0
- package/engines/arch-detect/rules/rule-registry.js +111 -0
- package/engines/arch-detect/types/context.types.js +60 -0
- package/engines/arch-detect/types/enums.js +161 -0
- package/engines/arch-detect/types/index.js +25 -0
- package/engines/arch-detect/types/result.types.js +7 -0
- package/engines/arch-detect/types/rule.types.js +7 -0
- package/engines/arch-detect/utils/file-scanner.js +411 -0
- package/engines/arch-detect/utils/index.js +23 -0
- package/engines/arch-detect/utils/pattern-matcher.js +328 -0
- package/engines/eslint-engine.js +2 -8
- package/engines/heuristic-engine.js +234 -38
- package/engines/impact/cli.js +106 -0
- package/engines/impact/config/default-config.js +54 -0
- package/engines/impact/core/change-detector.js +258 -0
- package/engines/impact/core/detectors/database-detector.js +1317 -0
- package/engines/impact/core/detectors/endpoint-detector.js +55 -0
- package/engines/impact/core/impact-analyzer.js +124 -0
- package/engines/impact/core/report-generator.js +462 -0
- package/engines/impact/core/utils/ast-parser.js +241 -0
- package/engines/impact/core/utils/dependency-graph.js +159 -0
- package/engines/impact/core/utils/file-utils.js +116 -0
- package/engines/impact/core/utils/git-utils.js +203 -0
- package/engines/impact/core/utils/logger.js +13 -0
- package/engines/impact/core/utils/method-call-graph.js +1192 -0
- package/engines/impact/index.js +135 -0
- package/engines/impact/package.json +29 -0
- package/package.json +18 -43
- package/rules/common/C002_no_duplicate_code/config.json +12 -20
- package/rules/common/C002_no_duplicate_code/dart/analyzer.js +53 -0
- package/rules/common/C002_no_duplicate_code/index.js +93 -0
- package/rules/common/C003_no_vague_abbreviations/config.json +1 -1
- package/rules/common/C003_no_vague_abbreviations/dart/analyzer.js +54 -0
- package/rules/common/C003_no_vague_abbreviations/index.js +93 -0
- package/rules/common/C006_function_naming/dart/analyzer.js +40 -0
- package/rules/common/C006_function_naming/index.js +86 -0
- package/rules/common/C008_variable_declaration_locality/dart/analyzer.js +32 -0
- package/rules/common/C008_variable_declaration_locality/index.js +86 -0
- package/rules/common/C010_limit_block_nesting/dart/analyzer.js +32 -0
- package/rules/common/C010_limit_block_nesting/index.js +86 -0
- package/rules/common/C012_command_query_separation/config.json +61 -0
- package/rules/common/C012_command_query_separation/dart/analyzer.js +32 -0
- package/rules/common/C012_command_query_separation/index.js +86 -0
- package/rules/common/C013_no_dead_code/dart/analyzer.js +32 -0
- package/rules/common/C013_no_dead_code/index.js +86 -0
- package/rules/common/C014_dependency_injection/dart/analyzer.js +32 -0
- package/rules/common/C014_dependency_injection/index.js +86 -0
- package/rules/common/C017_constructor_logic/dart/analyzer.js +32 -0
- package/rules/common/C017_constructor_logic/index.js +86 -0
- package/rules/common/C018_no_throw_generic_error/dart/analyzer.js +32 -0
- package/rules/common/C018_no_throw_generic_error/index.js +86 -0
- package/rules/common/C019_log_level_usage/dart/analyzer.js +32 -0
- package/rules/common/C019_log_level_usage/index.js +86 -0
- package/rules/common/C019_log_level_usage/{ts-morph-analyzer.js → typescript/ts-morph-analyzer.js} +0 -1
- package/rules/common/C020_unused_imports/dart/analyzer.js +32 -0
- package/rules/common/C020_unused_imports/index.js +86 -0
- package/rules/common/C020_unused_imports/{ts-morph-analyzer.js → typescript/ts-morph-analyzer.js} +0 -1
- package/rules/common/C021_import_organization/config.json +29 -9
- package/rules/common/C021_import_organization/dart/analyzer.js +40 -0
- package/rules/common/C021_import_organization/index.js +83 -0
- package/rules/common/C021_import_organization/{ts-morph-analyzer.js → typescript/ts-morph-analyzer.js} +0 -1
- package/rules/common/C023_no_duplicate_variable/config.json +7 -2
- package/rules/common/C023_no_duplicate_variable/dart/analyzer.js +40 -0
- package/rules/common/C023_no_duplicate_variable/index.js +83 -0
- package/rules/common/C024_no_scatter_hardcoded_constants/config.json +7 -2
- package/rules/common/C024_no_scatter_hardcoded_constants/dart/analyzer.js +40 -0
- package/rules/common/C024_no_scatter_hardcoded_constants/index.js +83 -0
- package/rules/common/C024_no_scatter_hardcoded_constants/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -1
- package/rules/common/C029_catch_block_logging/config.json +15 -5
- package/rules/common/C029_catch_block_logging/dart/analyzer.js +40 -0
- package/rules/common/C029_catch_block_logging/index.js +83 -0
- package/rules/common/C030_use_custom_error_classes/config.json +28 -0
- package/rules/common/C030_use_custom_error_classes/dart/analyzer.js +40 -0
- package/rules/common/C030_use_custom_error_classes/index.js +83 -0
- package/rules/common/C031_validation_separation/config.json +28 -0
- package/rules/common/C031_validation_separation/dart/analyzer.js +40 -0
- package/rules/common/C031_validation_separation/index.js +83 -0
- package/rules/common/C033_separate_service_repository/config.json +8 -3
- package/rules/common/C033_separate_service_repository/dart/analyzer.js +40 -0
- package/rules/common/C033_separate_service_repository/index.js +83 -0
- package/rules/common/C035_error_logging_context/config.json +34 -12
- package/rules/common/C035_error_logging_context/dart/analyzer.js +40 -0
- package/rules/common/C035_error_logging_context/index.js +83 -0
- package/rules/common/C040_centralized_validation/config.json +37 -8
- package/rules/common/C040_centralized_validation/dart/analyzer.js +40 -0
- package/rules/common/C040_centralized_validation/index.js +83 -0
- package/rules/common/C041_no_sensitive_hardcode/config.json +7 -2
- package/rules/common/C041_no_sensitive_hardcode/dart/analyzer.js +40 -0
- package/rules/common/C041_no_sensitive_hardcode/index.js +83 -0
- package/rules/common/C042_boolean_name_prefix/config.json +28 -0
- package/rules/common/C042_boolean_name_prefix/dart/analyzer.js +40 -0
- package/rules/common/C042_boolean_name_prefix/index.js +83 -0
- package/rules/common/C043_no_console_or_print/config.json +28 -0
- package/rules/common/C043_no_console_or_print/dart/analyzer.js +40 -0
- package/rules/common/C043_no_console_or_print/index.js +83 -0
- package/rules/common/C047_no_duplicate_retry_logic/config.json +28 -0
- package/rules/common/C047_no_duplicate_retry_logic/dart/analyzer.js +40 -0
- package/rules/common/C047_no_duplicate_retry_logic/index.js +83 -0
- package/rules/common/C048_no_bypass_architectural_layers/config.json +7 -2
- package/rules/common/C048_no_bypass_architectural_layers/dart/analyzer.js +40 -0
- package/rules/common/C048_no_bypass_architectural_layers/index.js +83 -0
- package/rules/common/C052_parsing_or_data_transformation/config.json +7 -2
- package/rules/common/C052_parsing_or_data_transformation/dart/analyzer.js +40 -0
- package/rules/common/C052_parsing_or_data_transformation/index.js +83 -0
- package/rules/common/C060_no_override_superclass/config.json +7 -2
- package/rules/common/C060_no_override_superclass/dart/analyzer.js +40 -0
- package/rules/common/C060_no_override_superclass/index.js +83 -0
- package/rules/common/C065_one_behavior_per_test/config.json +187 -28
- package/rules/common/C065_one_behavior_per_test/dart/analyzer.js +40 -0
- package/rules/common/C065_one_behavior_per_test/index.js +83 -0
- package/rules/common/C067_no_hardcoded_config/config.json +18 -4
- package/rules/common/C067_no_hardcoded_config/dart/analyzer.js +40 -0
- package/rules/common/C067_no_hardcoded_config/index.js +83 -0
- package/rules/common/C070_no_real_time_tests/config.json +41 -12
- package/rules/common/C070_no_real_time_tests/dart/analyzer.js +40 -0
- package/rules/common/C070_no_real_time_tests/index.js +83 -0
- package/rules/common/C072_single_test_behavior/config.json +28 -0
- package/rules/common/C072_single_test_behavior/dart/analyzer.js +40 -0
- package/rules/common/C072_single_test_behavior/index.js +83 -0
- package/rules/common/C073_validate_required_config_on_startup/config.json +93 -18
- package/rules/common/C073_validate_required_config_on_startup/dart/analyzer.js +40 -0
- package/rules/common/C073_validate_required_config_on_startup/index.js +83 -0
- package/rules/common/C073_validate_required_config_on_startup/{analyzer.js → typescript/analyzer.js} +0 -1
- package/rules/common/C075_explicit_return_types/config.json +28 -0
- package/rules/common/C075_explicit_return_types/dart/analyzer.js +40 -0
- package/rules/common/C075_explicit_return_types/index.js +83 -0
- package/rules/common/C076_explicit_function_types/config.json +18 -4
- package/rules/common/C076_explicit_function_types/dart/analyzer.js +40 -0
- package/rules/common/C076_explicit_function_types/index.js +83 -0
- package/rules/index.js +26 -6
- package/rules/security/S003_open_redirect_protection/config.json +11 -53
- package/rules/security/S003_open_redirect_protection/dart/analyzer.js +43 -0
- package/rules/security/S003_open_redirect_protection/index.js +94 -0
- package/rules/security/S003_open_redirect_protection/typescript/analyzer.js +105 -0
- package/rules/security/S003_open_redirect_protection/{symbol-based-analyzer.js → typescript/semantic-analyzer.js} +1 -1
- package/rules/security/S004_sensitive_data_logging/config.json +1 -1
- package/rules/security/S004_sensitive_data_logging/dart/analyzer.js +58 -0
- package/rules/security/S004_sensitive_data_logging/index.js +93 -0
- package/rules/security/S005_no_origin_auth/dart/analyzer.js +30 -0
- package/rules/security/S005_no_origin_auth/index.js +83 -0
- package/rules/security/S005_no_origin_auth/{analyzer.js → typescript/analyzer.js} +1 -0
- package/rules/security/S006_no_plaintext_recovery_codes/dart/analyzer.js +30 -0
- package/rules/security/S006_no_plaintext_recovery_codes/index.js +83 -0
- package/rules/security/S007_no_plaintext_otp/dart/analyzer.js +30 -0
- package/rules/security/S007_no_plaintext_otp/index.js +83 -0
- package/rules/security/S009_no_insecure_encryption/dart/analyzer.js +30 -0
- package/rules/security/S009_no_insecure_encryption/index.js +83 -0
- package/rules/security/S010_no_insecure_encryption/dart/analyzer.js +30 -0
- package/rules/security/S010_no_insecure_encryption/index.js +83 -0
- package/rules/security/S011_secure_guid_generation/dart/analyzer.js +30 -0
- package/rules/security/S011_secure_guid_generation/index.js +83 -0
- package/rules/security/S012_hardcoded_secrets/dart/analyzer.js +30 -0
- package/rules/security/S012_hardcoded_secrets/index.js +83 -0
- package/rules/security/S012_hardcoded_secrets/typescript/config.json +75 -0
- package/rules/security/S013_tls_enforcement/dart/analyzer.js +30 -0
- package/rules/security/S013_tls_enforcement/index.js +83 -0
- package/rules/security/S014_tls_version_enforcement/dart/analyzer.js +30 -0
- package/rules/security/S014_tls_version_enforcement/index.js +83 -0
- package/rules/security/S015_insecure_tls_certificate/config.json +41 -0
- package/rules/security/S015_insecure_tls_certificate/dart/analyzer.js +19 -0
- package/rules/security/S015_insecure_tls_certificate/index.js +83 -0
- package/rules/security/S016_no_sensitive_querystring/dart/analyzer.js +30 -0
- package/rules/security/S016_no_sensitive_querystring/index.js +83 -0
- package/rules/security/S017_use_parameterized_queries/dart/analyzer.js +30 -0
- package/rules/security/S017_use_parameterized_queries/index.js +83 -0
- package/rules/security/S019_smtp_injection_protection/dart/analyzer.js +30 -0
- package/rules/security/S019_smtp_injection_protection/index.js +83 -0
- package/rules/security/S020_no_eval_dynamic_code/dart/analyzer.js +30 -0
- package/rules/security/S020_no_eval_dynamic_code/index.js +83 -0
- package/rules/security/S022_escape_output_context/dart/analyzer.js +30 -0
- package/rules/security/S022_escape_output_context/index.js +83 -0
- package/rules/security/S023_no_json_injection/dart/analyzer.js +30 -0
- package/rules/security/S023_no_json_injection/index.js +83 -0
- package/rules/security/S024_xpath_xxe_protection/dart/analyzer.js +30 -0
- package/rules/security/S024_xpath_xxe_protection/index.js +83 -0
- package/rules/security/S025_server_side_validation/dart/analyzer.js +30 -0
- package/rules/security/S025_server_side_validation/index.js +83 -0
- package/rules/security/S026_json_schema_validation/dart/analyzer.js +30 -0
- package/rules/security/S026_json_schema_validation/index.js +83 -0
- package/rules/security/S027_no_hardcoded_secrets/dart/analyzer.js +30 -0
- package/rules/security/S027_no_hardcoded_secrets/index.js +83 -0
- package/rules/security/S028_file_upload_size_limits/dart/analyzer.js +30 -0
- package/rules/security/S028_file_upload_size_limits/index.js +83 -0
- package/rules/security/S029_csrf_protection/dart/analyzer.js +30 -0
- package/rules/security/S029_csrf_protection/index.js +83 -0
- package/rules/security/S030_directory_browsing_protection/dart/analyzer.js +30 -0
- package/rules/security/S030_directory_browsing_protection/index.js +83 -0
- package/rules/security/S031_secure_session_cookies/dart/analyzer.js +30 -0
- package/rules/security/S031_secure_session_cookies/index.js +83 -0
- package/rules/security/S032_httponly_session_cookies/dart/analyzer.js +30 -0
- package/rules/security/S032_httponly_session_cookies/index.js +83 -0
- package/rules/security/S033_samesite_session_cookies/dart/analyzer.js +30 -0
- package/rules/security/S033_samesite_session_cookies/index.js +83 -0
- package/rules/security/S034_host_prefix_session_cookies/dart/analyzer.js +30 -0
- package/rules/security/S034_host_prefix_session_cookies/index.js +83 -0
- package/rules/security/S035_path_session_cookies/dart/analyzer.js +30 -0
- package/rules/security/S035_path_session_cookies/index.js +83 -0
- package/rules/security/S036_lfi_rfi_protection/dart/analyzer.js +30 -0
- package/rules/security/S036_lfi_rfi_protection/index.js +83 -0
- package/rules/security/S037_cache_headers/dart/analyzer.js +30 -0
- package/rules/security/S037_cache_headers/index.js +83 -0
- package/rules/security/S038_no_version_headers/dart/analyzer.js +30 -0
- package/rules/security/S038_no_version_headers/index.js +83 -0
- package/rules/security/S039_no_session_tokens_in_url/dart/analyzer.js +30 -0
- package/rules/security/S039_no_session_tokens_in_url/index.js +83 -0
- package/rules/security/S040_session_fixation_protection/dart/analyzer.js +30 -0
- package/rules/security/S040_session_fixation_protection/index.js +83 -0
- package/rules/security/S041_session_token_invalidation/dart/analyzer.js +30 -0
- package/rules/security/S041_session_token_invalidation/index.js +83 -0
- package/rules/security/S042_require_re_authentication_for_long_lived/dart/analyzer.js +30 -0
- package/rules/security/S042_require_re_authentication_for_long_lived/index.js +83 -0
- package/rules/security/S043_password_changes_invalidate_all_sessions/dart/analyzer.js +30 -0
- package/rules/security/S043_password_changes_invalidate_all_sessions/index.js +83 -0
- package/rules/security/S044_re_authentication_required/dart/analyzer.js +30 -0
- package/rules/security/S044_re_authentication_required/index.js +83 -0
- package/rules/security/S045_brute_force_protection/dart/analyzer.js +30 -0
- package/rules/security/S045_brute_force_protection/index.js +83 -0
- package/rules/security/S048_no_current_password_in_reset/dart/analyzer.js +30 -0
- package/rules/security/S048_no_current_password_in_reset/index.js +83 -0
- package/rules/security/S049_short_validity_tokens/dart/analyzer.js +30 -0
- package/rules/security/S049_short_validity_tokens/index.js +83 -0
- package/rules/security/S049_short_validity_tokens/typescript/config.json +124 -0
- package/rules/security/S051_password_length_policy/dart/analyzer.js +30 -0
- package/rules/security/S051_password_length_policy/index.js +83 -0
- package/rules/security/S051_password_length_policy/typescript/config.json +83 -0
- package/rules/security/S052_weak_otp_entropy/dart/analyzer.js +30 -0
- package/rules/security/S052_weak_otp_entropy/index.js +83 -0
- package/rules/security/S052_weak_otp_entropy/typescript/config.json +57 -0
- package/rules/security/S054_no_default_accounts/dart/analyzer.js +30 -0
- package/rules/security/S054_no_default_accounts/index.js +83 -0
- package/rules/security/S054_no_default_accounts/typescript/config.json +101 -0
- package/rules/security/S055_content_type_validation/dart/analyzer.js +30 -0
- package/rules/security/S055_content_type_validation/index.js +83 -0
- package/rules/security/S056_log_injection_protection/dart/analyzer.js +30 -0
- package/rules/security/S056_log_injection_protection/index.js +83 -0
- package/rules/security/S057_utc_logging/dart/analyzer.js +30 -0
- package/rules/security/S057_utc_logging/index.js +83 -0
- package/rules/security/S057_utc_logging/typescript/config.json +105 -0
- package/rules/security/S058_no_ssrf/dart/analyzer.js +30 -0
- package/rules/security/S058_no_ssrf/index.js +83 -0
- package/rules/security/S058_no_ssrf/{analyzer.js → typescript/analyzer.js} +0 -1
- package/rules/security/S058_no_ssrf/typescript/config.json +125 -0
- package/scripts/build-release.sh +12 -0
- package/scripts/copy-impact-analyzer.js +135 -0
- package/scripts/install.sh +0 -0
- package/scripts/manual-release.sh +0 -0
- package/scripts/pre-release-test.sh +0 -0
- package/scripts/prepare-release.sh +0 -0
- package/scripts/quick-performance-test.js +0 -0
- package/scripts/setup-github-registry.sh +0 -0
- package/scripts/trigger-release.sh +0 -0
- package/scripts/verify-install.sh +0 -0
- package/templates/combined-report.html +1418 -0
- package/rules/common/C002_no_duplicate_code/test-cases/api-handlers.ts +0 -64
- package/rules/common/C002_no_duplicate_code/test-cases/data-processor.ts +0 -46
- package/rules/common/C002_no_duplicate_code/test-cases/good-example.tsx +0 -40
- package/rules/common/C002_no_duplicate_code/test-cases/product-service.ts +0 -57
- package/rules/common/C002_no_duplicate_code/test-cases/user-service.ts +0 -49
- package/rules/common/C067_no_hardcoded_config/symbol-based-analyzer.js.backup +0 -3853
- package/rules/security/S003_open_redirect_protection/analyzer.js +0 -135
- /package/rules/common/C002_no_duplicate_code/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C003_no_vague_abbreviations/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C006_function_naming/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/{C008 → C008_variable_declaration_locality}/config.json +0 -0
- /package/rules/common/{C008 → C008_variable_declaration_locality/typescript}/analyzer.js +0 -0
- /package/rules/common/{C008 → C008_variable_declaration_locality/typescript}/ts-morph-analyzer.js +0 -0
- /package/rules/common/C010_limit_block_nesting/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C010_limit_block_nesting/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/common/C010_limit_block_nesting/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C012_command_query_separation/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C012_command_query_separation/{ast-analyzer.js → typescript/ast-analyzer.js} +0 -0
- /package/rules/common/C013_no_dead_code/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C013_no_dead_code/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/common/C013_no_dead_code/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C014_dependency_injection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C014_dependency_injection/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C017_constructor_logic/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C017_constructor_logic/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C018_no_throw_generic_error/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C018_no_throw_generic_error/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/common/C018_no_throw_generic_error/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C019_log_level_usage/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C019_log_level_usage/{pattern-analyzer.js → typescript/pattern-analyzer.js} +0 -0
- /package/rules/common/C019_log_level_usage/{system-log-analyzer.js → typescript/system-log-analyzer.js} +0 -0
- /package/rules/common/C020_unused_imports/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C021_import_organization/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C023_no_duplicate_variable/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C023_no_duplicate_variable/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C024_no_scatter_hardcoded_constants/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C029_catch_block_logging/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C030_use_custom_error_classes/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C031_validation_separation/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C033_separate_service_repository/{README.md → typescript/README.md} +0 -0
- /package/rules/common/C033_separate_service_repository/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C033_separate_service_repository/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/common/C033_separate_service_repository/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C035_error_logging_context/{STRATEGY.md → typescript/STRATEGY.md} +0 -0
- /package/rules/common/C035_error_logging_context/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C035_error_logging_context/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/common/C035_error_logging_context/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C040_centralized_validation/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C040_centralized_validation/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/common/C040_centralized_validation/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C041_no_sensitive_hardcode/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C041_no_sensitive_hardcode/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C042_boolean_name_prefix/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C043_no_console_or_print/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C047_no_duplicate_retry_logic/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C047_no_duplicate_retry_logic/{c047-semantic-rule.js → typescript/c047-semantic-rule.js} +0 -0
- /package/rules/common/C047_no_duplicate_retry_logic/{symbol-analyzer-enhanced.js → typescript/symbol-analyzer-enhanced.js} +0 -0
- /package/rules/common/C047_no_duplicate_retry_logic/{symbol-config.json → typescript/symbol-config.json} +0 -0
- /package/rules/common/C048_no_bypass_architectural_layers/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C048_no_bypass_architectural_layers/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C052_parsing_or_data_transformation/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C052_parsing_or_data_transformation/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C060_no_override_superclass/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C060_no_override_superclass/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C065_one_behavior_per_test/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C067_no_hardcoded_config/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C067_no_hardcoded_config/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C070_no_real_time_tests/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C070_no_real_time_tests/{regex-analyzer.js → typescript/regex-analyzer.js} +0 -0
- /package/rules/common/C072_single_test_behavior/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C073_validate_required_config_on_startup/{README.md → typescript/README.md} +0 -0
- /package/rules/common/C073_validate_required_config_on_startup/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/common/C075_explicit_return_types/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C076_explicit_function_types/{README.md → typescript/README.md} +0 -0
- /package/rules/common/C076_explicit_function_types/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/common/C076_explicit_function_types/{semantic-analyzer.js → typescript/semantic-analyzer.js} +0 -0
- /package/rules/security/S003_open_redirect_protection/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S004_sensitive_data_logging/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S004_sensitive_data_logging/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S005_no_origin_auth/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S005_no_origin_auth/{ast-analyzer.js → typescript/ast-analyzer.js} +0 -0
- /package/rules/security/S005_no_origin_auth/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S006_no_plaintext_recovery_codes/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S006_no_plaintext_recovery_codes/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S006_no_plaintext_recovery_codes/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S007_no_plaintext_otp/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S007_no_plaintext_otp/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S007_no_plaintext_otp/{semantic-analyzer.js → typescript/semantic-analyzer.js} +0 -0
- /package/rules/security/S007_no_plaintext_otp/{semantic-config.json → typescript/semantic-config.json} +0 -0
- /package/rules/security/S007_no_plaintext_otp/{semantic-wrapper.js → typescript/semantic-wrapper.js} +0 -0
- /package/rules/security/S009_no_insecure_encryption/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S009_no_insecure_encryption/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S010_no_insecure_encryption/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S010_no_insecure_encryption/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S011_secure_guid_generation/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S011_secure_guid_generation/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S011_secure_guid_generation/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S012_hardcoded_secrets/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S012_hardcoded_secrets/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S013_tls_enforcement/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S013_tls_enforcement/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S013_tls_enforcement/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S014_tls_version_enforcement/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S014_tls_version_enforcement/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S014_tls_version_enforcement/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S015_insecure_tls_certificate/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S015_insecure_tls_certificate/{ast-analyzer.js → typescript/ast-analyzer.js} +0 -0
- /package/rules/security/S016_no_sensitive_querystring/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S016_no_sensitive_querystring/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S016_no_sensitive_querystring/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S017_use_parameterized_queries/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S017_use_parameterized_queries/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S017_use_parameterized_queries/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S019_smtp_injection_protection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S019_smtp_injection_protection/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S020_no_eval_dynamic_code/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S020_no_eval_dynamic_code/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S020_no_eval_dynamic_code/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S022_escape_output_context/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S022_escape_output_context/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S023_no_json_injection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S023_no_json_injection/{ast-analyzer.js → typescript/ast-analyzer.js} +0 -0
- /package/rules/security/S024_xpath_xxe_protection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S024_xpath_xxe_protection/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S024_xpath_xxe_protection/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S025_server_side_validation/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S025_server_side_validation/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S025_server_side_validation/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S025_server_side_validation/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S026_json_schema_validation/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S027_no_hardcoded_secrets/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S027_no_hardcoded_secrets/{categories.json → typescript/categories.json} +0 -0
- /package/rules/security/S027_no_hardcoded_secrets/{categorized-analyzer.js → typescript/categorized-analyzer.js} +0 -0
- /package/rules/security/S028_file_upload_size_limits/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S028_file_upload_size_limits/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S028_file_upload_size_limits/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S029_csrf_protection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S030_directory_browsing_protection/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S030_directory_browsing_protection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S030_directory_browsing_protection/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S030_directory_browsing_protection/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S031_secure_session_cookies/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S031_secure_session_cookies/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S031_secure_session_cookies/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S032_httponly_session_cookies/{FRAMEWORK_SUPPORT.md → typescript/FRAMEWORK_SUPPORT.md} +0 -0
- /package/rules/security/S032_httponly_session_cookies/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S032_httponly_session_cookies/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S032_httponly_session_cookies/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S032_httponly_session_cookies/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S033_samesite_session_cookies/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S033_samesite_session_cookies/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S033_samesite_session_cookies/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S033_samesite_session_cookies/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S034_host_prefix_session_cookies/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S034_host_prefix_session_cookies/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S034_host_prefix_session_cookies/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S034_host_prefix_session_cookies/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S035_path_session_cookies/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S035_path_session_cookies/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S035_path_session_cookies/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S035_path_session_cookies/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S036_lfi_rfi_protection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S037_cache_headers/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S037_cache_headers/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S037_cache_headers/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S037_cache_headers/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S038_no_version_headers/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S038_no_version_headers/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S038_no_version_headers/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S038_no_version_headers/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S039_no_session_tokens_in_url/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S039_no_session_tokens_in_url/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S039_no_session_tokens_in_url/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S039_no_session_tokens_in_url/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S040_session_fixation_protection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S041_session_token_invalidation/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S041_session_token_invalidation/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S041_session_token_invalidation/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S041_session_token_invalidation/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S042_require_re_authentication_for_long_lived/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S042_require_re_authentication_for_long_lived/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S042_require_re_authentication_for_long_lived/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S043_password_changes_invalidate_all_sessions/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S043_password_changes_invalidate_all_sessions/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S043_password_changes_invalidate_all_sessions/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S044_re_authentication_required/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S044_re_authentication_required/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S044_re_authentication_required/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S044_re_authentication_required/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S045_brute_force_protection/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S045_brute_force_protection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S045_brute_force_protection/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S048_no_current_password_in_reset/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S048_no_current_password_in_reset/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S049_short_validity_tokens/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S049_short_validity_tokens/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S049_short_validity_tokens/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S051_password_length_policy/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S052_weak_otp_entropy/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S054_no_default_accounts/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S054_no_default_accounts/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S055_content_type_validation/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S055_content_type_validation/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S055_content_type_validation/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S056_log_injection_protection/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S056_log_injection_protection/{regex-based-analyzer.js → typescript/regex-based-analyzer.js} +0 -0
- /package/rules/security/S056_log_injection_protection/{symbol-based-analyzer.js → typescript/symbol-based-analyzer.js} +0 -0
- /package/rules/security/S057_utc_logging/{README.md → typescript/README.md} +0 -0
- /package/rules/security/S057_utc_logging/{analyzer.js → typescript/analyzer.js} +0 -0
- /package/rules/security/S058_no_ssrf/{README.md → typescript/README.md} +0 -0
|
@@ -16,16 +16,15 @@ class ArchitectureIntegration {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Load architecture detection module
|
|
19
|
-
* Tries bundled
|
|
19
|
+
* Tries bundled (engines/) first, then npm package, then local dev paths
|
|
20
20
|
*/
|
|
21
21
|
async loadArchitectureModule() {
|
|
22
22
|
if (this.archModule) {
|
|
23
23
|
return this.archModule;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// Try bundled version
|
|
26
|
+
// Priority 1: Try bundled version (engines/arch-detect) - for published package
|
|
27
27
|
const bundledPath = path.join(__dirname, '..', 'engines', 'arch-detect', 'index.js');
|
|
28
|
-
|
|
29
28
|
if (fs.existsSync(bundledPath)) {
|
|
30
29
|
try {
|
|
31
30
|
this.archModule = require(bundledPath);
|
|
@@ -35,12 +34,23 @@ class ArchitectureIntegration {
|
|
|
35
34
|
return this.archModule;
|
|
36
35
|
} catch (error) {
|
|
37
36
|
if (this.options.verbose) {
|
|
38
|
-
console.log(chalk.yellow(`⚠️ Failed to load bundled
|
|
37
|
+
console.log(chalk.yellow(`⚠️ Failed to load bundled: ${error.message}`));
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
//
|
|
42
|
+
// Priority 2: Try npm package (workspace link) - for local development
|
|
43
|
+
try {
|
|
44
|
+
this.archModule = require('@sunlint/architecture-detection');
|
|
45
|
+
if (this.options.verbose) {
|
|
46
|
+
console.log(chalk.gray('📦 Loaded @sunlint/architecture-detection package'));
|
|
47
|
+
}
|
|
48
|
+
return this.archModule;
|
|
49
|
+
} catch (error) {
|
|
50
|
+
// Package not found, continue to fallback
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Priority 3: Try local development paths
|
|
44
54
|
const devPaths = [
|
|
45
55
|
path.join(__dirname, '..', '..', '..', '..', 'architecture-detection', 'dist', 'index.js'),
|
|
46
56
|
path.join(__dirname, '..', '..', '..', 'architecture-detection', 'dist', 'index.js'),
|
|
@@ -63,8 +73,7 @@ class ArchitectureIntegration {
|
|
|
63
73
|
}
|
|
64
74
|
|
|
65
75
|
throw new Error(
|
|
66
|
-
'Architecture detection module not found. Run "npm run build"
|
|
67
|
-
'or ensure architecture-detection is built in the parent directory.'
|
|
76
|
+
'Architecture detection module not found. Run "npm run build" in sunlint directory.'
|
|
68
77
|
);
|
|
69
78
|
}
|
|
70
79
|
|
|
@@ -76,7 +76,7 @@ class AutoPerformanceManager {
|
|
|
76
76
|
analyzeProject(options, targetFiles) {
|
|
77
77
|
const fileCount = targetFiles.length;
|
|
78
78
|
const inputPath = options.input || process.cwd();
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
// Estimate project complexity
|
|
81
81
|
const hasNodeModules = fs.existsSync(path.join(inputPath, 'node_modules'));
|
|
82
82
|
const hasPackageJson = fs.existsSync(path.join(inputPath, 'package.json'));
|
|
@@ -15,6 +15,7 @@ const OutputService = require('./output-service');
|
|
|
15
15
|
const GitUtils = require('./git-utils');
|
|
16
16
|
const FileTargetingService = require('./file-targeting-service');
|
|
17
17
|
const { ArchitectureIntegration } = require('./architecture-integration');
|
|
18
|
+
const { ImpactIntegration } = require('./impact-integration');
|
|
18
19
|
|
|
19
20
|
// Legacy orchestrator for fallback
|
|
20
21
|
// const LegacyOrchestrator = require('./legacy-analysis-orchestrator'); // Removed
|
|
@@ -83,8 +84,8 @@ class CliActionHandler {
|
|
|
83
84
|
const startTime = Date.now();
|
|
84
85
|
let results = null;
|
|
85
86
|
|
|
86
|
-
// Run code quality analysis (unless --architecture is used alone)
|
|
87
|
-
if (rulesToRun.length > 0 && !this.isArchitectureOnly()) {
|
|
87
|
+
// Run code quality analysis (unless --architecture or --impact is used alone)
|
|
88
|
+
if (rulesToRun.length > 0 && !this.isArchitectureOnly() && !this.isImpactOnly()) {
|
|
88
89
|
results = await this.runModernAnalysis(rulesToRun, targetingResult.files, config);
|
|
89
90
|
} else {
|
|
90
91
|
results = { results: [], summary: { total: 0, errors: 0, warnings: 0 } };
|
|
@@ -96,6 +97,12 @@ class CliActionHandler {
|
|
|
96
97
|
results.architecture = architectureResults;
|
|
97
98
|
}
|
|
98
99
|
|
|
100
|
+
// Run impact analysis if requested
|
|
101
|
+
if (this.options.impact) {
|
|
102
|
+
const impactResults = await this.runImpactAnalysis();
|
|
103
|
+
results.impact = impactResults;
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
const duration = Date.now() - startTime;
|
|
100
107
|
|
|
101
108
|
// Output results
|
|
@@ -130,8 +137,6 @@ class CliActionHandler {
|
|
|
130
137
|
*/
|
|
131
138
|
async runModernAnalysis(rulesToRun, files, config) {
|
|
132
139
|
if (this.isModernMode) {
|
|
133
|
-
console.log(chalk.blue('🚀 Using modern engine architecture'));
|
|
134
|
-
|
|
135
140
|
// Initialize orchestrator with configuration including targetFiles for optimization
|
|
136
141
|
await this.orchestrator.initialize({
|
|
137
142
|
enabledEngines: this.determineEnabledEngines(config),
|
|
@@ -268,15 +273,13 @@ class CliActionHandler {
|
|
|
268
273
|
}
|
|
269
274
|
|
|
270
275
|
const { version } = require('../package.json');
|
|
271
|
-
|
|
272
|
-
console.log(
|
|
273
|
-
|
|
276
|
+
|
|
277
|
+
console.log();
|
|
278
|
+
console.log(chalk.gray(' ') + chalk.yellow.bold(`☀️ SunLint `) + chalk.gray(`v${version}`));
|
|
279
|
+
|
|
274
280
|
if (this.options.debug) {
|
|
275
|
-
console.log(chalk.
|
|
276
|
-
console.log('Architecture:', this.isModernMode ? 'Plugin-based' : 'Legacy');
|
|
277
|
-
console.log('Options:', this.options);
|
|
281
|
+
console.log(chalk.gray(' Debug mode enabled'));
|
|
278
282
|
}
|
|
279
|
-
console.log();
|
|
280
283
|
}
|
|
281
284
|
|
|
282
285
|
// Delegate methods to base functionality (same as original CliActionHandler)
|
|
@@ -478,16 +481,7 @@ class CliActionHandler {
|
|
|
478
481
|
*/
|
|
479
482
|
displayAnalysisInfo(rulesToRun, targetingResult) {
|
|
480
483
|
if (this.options.quiet) return;
|
|
481
|
-
|
|
482
|
-
console.log(chalk.blue('📊 Analysis Configuration:'));
|
|
483
|
-
console.log(`• Rules: ${rulesToRun.length} selected`);
|
|
484
|
-
console.log(`• Files: ${targetingResult.files.length} targeted`);
|
|
485
|
-
console.log(`• Architecture: ${this.isModernMode ? 'Modern Plugin-based' : 'Legacy'}`);
|
|
486
|
-
|
|
487
|
-
if (this.options.debug) {
|
|
488
|
-
console.log(`• Rules: ${rulesToRun.map(r => r.id).join(', ')}`);
|
|
489
|
-
}
|
|
490
|
-
console.log();
|
|
484
|
+
// Info is now shown in analysis-orchestrator with rule breakdown
|
|
491
485
|
}
|
|
492
486
|
|
|
493
487
|
/**
|
|
@@ -528,6 +522,22 @@ class CliActionHandler {
|
|
|
528
522
|
*/
|
|
529
523
|
isArchitectureOnly() {
|
|
530
524
|
return this.options.architecture &&
|
|
525
|
+
!this.options.impact &&
|
|
526
|
+
!this.options.all &&
|
|
527
|
+
!this.options.rule &&
|
|
528
|
+
!this.options.rules &&
|
|
529
|
+
!this.options.quality &&
|
|
530
|
+
!this.options.security &&
|
|
531
|
+
!this.options.category;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Check if only impact analysis was requested (no code quality rules)
|
|
536
|
+
* Following Rule C006: Verb-noun naming
|
|
537
|
+
*/
|
|
538
|
+
isImpactOnly() {
|
|
539
|
+
return this.options.impact &&
|
|
540
|
+
!this.options.architecture &&
|
|
531
541
|
!this.options.all &&
|
|
532
542
|
!this.options.rule &&
|
|
533
543
|
!this.options.rules &&
|
|
@@ -567,6 +577,73 @@ class CliActionHandler {
|
|
|
567
577
|
return null;
|
|
568
578
|
}
|
|
569
579
|
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Run impact analysis using impact-analyzer module
|
|
583
|
+
* Following Rule C006: Verb-noun naming
|
|
584
|
+
*/
|
|
585
|
+
async runImpactAnalysis() {
|
|
586
|
+
if (!this.options.quiet) {
|
|
587
|
+
console.log(chalk.blue('\n🔍 Running impact analysis...'));
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
try {
|
|
591
|
+
const integration = new ImpactIntegration({
|
|
592
|
+
...this.options,
|
|
593
|
+
impactBase: this.options.impactBase || 'HEAD~1',
|
|
594
|
+
impactReport: this.options.impactReport,
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
const projectPath = this.getProjectPath();
|
|
598
|
+
const results = await integration.analyze(projectPath);
|
|
599
|
+
|
|
600
|
+
// Display summary
|
|
601
|
+
if (!this.options.quiet && results.summary) {
|
|
602
|
+
const { summary } = results;
|
|
603
|
+
const severityColors = {
|
|
604
|
+
critical: chalk.red,
|
|
605
|
+
high: chalk.yellow,
|
|
606
|
+
medium: chalk.cyan,
|
|
607
|
+
low: chalk.green,
|
|
608
|
+
none: chalk.gray,
|
|
609
|
+
};
|
|
610
|
+
const colorFn = severityColors[summary.severity] || chalk.white;
|
|
611
|
+
|
|
612
|
+
console.log(chalk.gray(`\n Base: ${summary.baseRef}`));
|
|
613
|
+
console.log(chalk.gray(` Changes: ${summary.totalChanges} files`));
|
|
614
|
+
console.log(` Impact: ${colorFn(summary.impactScore + '/100')} (${colorFn(summary.severity.toUpperCase())})`);
|
|
615
|
+
|
|
616
|
+
if (summary.categories) {
|
|
617
|
+
const cats = Object.entries(summary.categories)
|
|
618
|
+
.filter(([, count]) => count > 0)
|
|
619
|
+
.map(([cat, count]) => `${cat}:${count}`)
|
|
620
|
+
.join(' · ');
|
|
621
|
+
if (cats) {
|
|
622
|
+
console.log(chalk.gray(` Categories: ${cats}`));
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// Save markdown report if requested
|
|
628
|
+
if (this.options.impactReport && results.markdownReport) {
|
|
629
|
+
const reportPath = await integration.saveReport(
|
|
630
|
+
results.markdownReport,
|
|
631
|
+
this.options.impactReport
|
|
632
|
+
);
|
|
633
|
+
if (!this.options.quiet) {
|
|
634
|
+
console.log(chalk.green(`\n📄 Impact report saved: ${reportPath}`));
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
return results;
|
|
639
|
+
} catch (error) {
|
|
640
|
+
console.error(chalk.yellow(`⚠️ Impact analysis failed: ${error.message}`));
|
|
641
|
+
if (this.options.verbose || this.options.debug) {
|
|
642
|
+
console.error(error.stack);
|
|
643
|
+
}
|
|
644
|
+
return null;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
570
647
|
}
|
|
571
648
|
|
|
572
649
|
module.exports = CliActionHandler;
|
package/core/cli-program.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI Program Definition
|
|
3
|
-
*
|
|
3
|
+
* Defines all CLI options and help text for SunLint
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const { Command } = require('commander');
|
|
@@ -11,169 +11,127 @@ function createCliProgram() {
|
|
|
11
11
|
|
|
12
12
|
program
|
|
13
13
|
.name('sunlint')
|
|
14
|
-
.description('☀️
|
|
14
|
+
.description('☀️ SunLint - Multi-language Static Analysis Tool | Code Quality & Security')
|
|
15
15
|
.version(version);
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// ──────────────────────────────────────────────────────────────
|
|
18
|
+
// Rule Selection
|
|
19
|
+
// ──────────────────────────────────────────────────────────────
|
|
18
20
|
program
|
|
19
21
|
.option('-r, --rule <rule>', 'Run single rule (e.g., C019)')
|
|
20
|
-
.option('--rules <rules>', 'Run multiple rules (comma-separated
|
|
22
|
+
.option('--rules <rules>', 'Run multiple rules (comma-separated)')
|
|
21
23
|
.option('-a, --all', 'Run all available rules')
|
|
22
|
-
.option('-c, --category <category>', 'Run rules by category (quality,security,logging,naming)')
|
|
24
|
+
.option('-c, --category <category>', 'Run rules by category (quality, security, logging, naming)')
|
|
23
25
|
.option('--quality', 'Run all code quality rules')
|
|
24
26
|
.option('--security', 'Run all secure coding rules');
|
|
25
27
|
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.option('--arch-patterns <patterns>', 'Target specific architecture patterns (comma-separated)')
|
|
30
|
-
.option('--arch-report', 'Generate separate architecture MD report');
|
|
31
|
-
|
|
32
|
-
// TypeScript specific options (Phase 1 focus)
|
|
33
|
-
program
|
|
34
|
-
.option('--typescript', 'Enable TypeScript-specific analysis')
|
|
35
|
-
.option('--typescript-engine <engine>', 'TypeScript analysis engine (eslint,heuristic,hybrid)', 'heuristic')
|
|
36
|
-
.option('--ensure-deps', 'Ensure ESLint dependencies are installed');
|
|
37
|
-
|
|
38
|
-
// Input/Output options (v1.x: explicit --input required)
|
|
28
|
+
// ──────────────────────────────────────────────────────────────
|
|
29
|
+
// Input/Output
|
|
30
|
+
// ──────────────────────────────────────────────────────────────
|
|
39
31
|
program
|
|
40
32
|
.option('-i, --input <path>', 'Input file or directory to analyze (REQUIRED)')
|
|
41
|
-
.option('-f, --format <format>', 'Output format
|
|
42
|
-
.option('-o, --output <file>', '
|
|
43
|
-
.option('--output-summary <file>', '
|
|
44
|
-
.option('--
|
|
45
|
-
.option('--config <file>', 'Configuration file path
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// File
|
|
33
|
+
.option('-f, --format <format>', 'Output format: eslint, json, summary, table', 'eslint')
|
|
34
|
+
.option('-o, --output <file>', 'Write output to file')
|
|
35
|
+
.option('--output-summary <file>', 'Write JSON summary for CI/CD')
|
|
36
|
+
.option('--output-html [file]', 'Generate HTML report (default: sunlint-report.html)')
|
|
37
|
+
.option('--config <file>', 'Configuration file path');
|
|
38
|
+
|
|
39
|
+
// ──────────────────────────────────────────────────────────────
|
|
40
|
+
// File Targeting
|
|
41
|
+
// ──────────────────────────────────────────────────────────────
|
|
49
42
|
program
|
|
50
43
|
.option('--include <patterns>', 'Include file patterns (comma-separated globs)')
|
|
51
44
|
.option('--exclude <patterns>', 'Exclude file patterns (comma-separated globs)')
|
|
52
|
-
.option('--languages <
|
|
53
|
-
.option('--include-tests', 'Include test files in analysis (default: true)')
|
|
45
|
+
.option('--languages <langs>', 'Target languages: typescript, dart, kotlin, swift, java')
|
|
54
46
|
.option('--exclude-tests', 'Exclude test files from analysis')
|
|
55
|
-
.option('--only-source', 'Only analyze source files (exclude tests, configs
|
|
47
|
+
.option('--only-source', 'Only analyze source files (exclude tests, configs)');
|
|
56
48
|
|
|
57
|
-
//
|
|
49
|
+
// ──────────────────────────────────────────────────────────────
|
|
50
|
+
// Git Integration
|
|
51
|
+
// ──────────────────────────────────────────────────────────────
|
|
58
52
|
program
|
|
59
|
-
.option('--changed-files', 'Only analyze
|
|
53
|
+
.option('--changed-files', 'Only analyze changed files (git diff)')
|
|
60
54
|
.option('--staged-files', 'Only analyze staged files (git diff --cached)')
|
|
61
|
-
.option('--diff-base <ref>', 'Compare against
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.option('--fail-on-new-violations', 'Exit with error only on new violations (not existing)');
|
|
67
|
-
|
|
68
|
-
// Performance options (SIMPLIFIED)
|
|
55
|
+
.option('--diff-base <ref>', 'Compare against git ref (e.g., origin/main)');
|
|
56
|
+
|
|
57
|
+
// ──────────────────────────────────────────────────────────────
|
|
58
|
+
// GitHub Actions
|
|
59
|
+
// ──────────────────────────────────────────────────────────────
|
|
69
60
|
program
|
|
70
|
-
.option('--
|
|
71
|
-
.option('--
|
|
72
|
-
.option('--performance <mode>', 'Performance mode: auto, fast, careful (default: auto)', 'auto');
|
|
61
|
+
.option('--github-annotate [mode]', 'GitHub PR annotations (modes: annotate, summary, all)')
|
|
62
|
+
.option('--upload-report [url]', 'Upload report to API (default: Sun* Coding Standards)');
|
|
73
63
|
|
|
74
|
-
//
|
|
64
|
+
// ──────────────────────────────────────────────────────────────
|
|
65
|
+
// Analysis Options
|
|
66
|
+
// ──────────────────────────────────────────────────────────────
|
|
67
|
+
program
|
|
68
|
+
.option('--typescript', 'Enable TypeScript-specific analysis')
|
|
69
|
+
.option('--architecture', 'Enable architecture pattern detection')
|
|
70
|
+
.option('--arch-patterns <patterns>', 'Target architecture patterns (comma-separated)')
|
|
71
|
+
.option('--arch-report', 'Generate architecture markdown report')
|
|
72
|
+
.option('--impact', 'Enable impact analysis (analyze code changes)')
|
|
73
|
+
.option('--impact-base <ref>', 'Base git ref for impact analysis (default: HEAD~1)')
|
|
74
|
+
.option('--impact-report <file>', 'Output impact report file (default: impact-report.md)')
|
|
75
|
+
.option('--engine <engine>', 'Analysis engine: auto, eslint, heuristic', 'auto')
|
|
76
|
+
.option('--eslint-integration', 'Merge with existing ESLint config')
|
|
77
|
+
.option('--no-eslint-integration', 'Disable ESLint integration');
|
|
78
|
+
|
|
79
|
+
// ──────────────────────────────────────────────────────────────
|
|
80
|
+
// Performance
|
|
81
|
+
// ──────────────────────────────────────────────────────────────
|
|
82
|
+
program
|
|
83
|
+
.option('--performance <mode>', 'Performance mode: auto, fast, careful', 'auto')
|
|
84
|
+
.option('--timeout <ms>', 'Analysis timeout in milliseconds', '0')
|
|
85
|
+
.option('--max-files <n>', 'Maximum files to analyze', '0')
|
|
86
|
+
.option('--max-semantic-files <n>', 'TypeScript symbol table limit (default: 1000)');
|
|
87
|
+
|
|
88
|
+
// ──────────────────────────────────────────────────────────────
|
|
89
|
+
// Output Control
|
|
90
|
+
// ──────────────────────────────────────────────────────────────
|
|
75
91
|
program
|
|
76
|
-
.option('--engine <engine>', 'Analysis engine (eslint,heuristic,auto)', 'auto')
|
|
77
|
-
.option('--dry-run', 'Show what would be analyzed without running')
|
|
78
92
|
.option('--verbose', 'Enable verbose logging')
|
|
79
93
|
.option('--quiet', 'Suppress non-error output')
|
|
80
|
-
.option('--debug', 'Enable debug mode')
|
|
81
94
|
.option('--ai', 'Enable AI-powered analysis')
|
|
82
|
-
.option('--no-ai', '
|
|
83
|
-
.option('--max-semantic-files <number>', 'Symbol table file limit for TypeScript analysis (default: 1000, -1 for unlimited)')
|
|
84
|
-
.option('--list-engines', 'List available analysis engines');
|
|
85
|
-
|
|
86
|
-
// ESLint Integration options
|
|
87
|
-
program
|
|
88
|
-
.option('--eslint-integration', 'Enable ESLint integration (merge with existing ESLint config)')
|
|
89
|
-
.option('--no-eslint-integration', 'Disable ESLint integration')
|
|
90
|
-
.option('--eslint-merge-rules', 'Merge SunLint and user ESLint rules (default: true)')
|
|
91
|
-
.option('--eslint-preserve-config', 'Preserve user ESLint configuration (default: true)')
|
|
92
|
-
.option('--eslint-run-after', 'Run ESLint after SunLint (instead of merged execution)');
|
|
95
|
+
.option('--no-ai', 'Disable AI analysis');
|
|
93
96
|
|
|
94
|
-
//
|
|
97
|
+
// ──────────────────────────────────────────────────────────────
|
|
98
|
+
// Help Examples
|
|
99
|
+
// ──────────────────────────────────────────────────────────────
|
|
95
100
|
program.addHelpText('after', `
|
|
96
101
|
Examples:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
Engine Configuration:
|
|
132
|
-
$ sunlint --all --input=src # Use config engine setting
|
|
133
|
-
$ sunlint --all --input=src --engine=eslint # Force ESLint engine
|
|
134
|
-
$ sunlint --all --input=src --engine=heuristic # Force Heuristic engine
|
|
135
|
-
|
|
136
|
-
CI/CD Integration:
|
|
137
|
-
$ sunlint --all --changed-files --format=summary --no-ai
|
|
138
|
-
$ sunlint --all --changed-files --diff-base=origin/main --fail-on-new-violations
|
|
139
|
-
$ sunlint --all --staged-files --format=summary
|
|
140
|
-
$ sunlint --all --pr-mode --diff-base=origin/main
|
|
141
|
-
$ sunlint --all --output-summary=report.json --upload-report
|
|
142
|
-
$ sunlint --all --output-summary=report.json --upload-report=https://custom-api.com/reports
|
|
143
|
-
|
|
144
|
-
GitHub Actions Integration:
|
|
145
|
-
$ sunlint --all --input=src --github-annotate # Inline + summary + HTML artifact
|
|
146
|
-
$ sunlint --all --input=src --github-annotate=annotate # Inline comments only
|
|
147
|
-
$ sunlint --all --input=src --github-annotate=summary # Summary comment + HTML artifact
|
|
148
|
-
$ sunlint --all --input=src --github-annotate=all # All features (default)
|
|
149
|
-
$ sunlint --all --changed-files --github-annotate # With changed files only
|
|
150
|
-
|
|
151
|
-
ESLint Integration:
|
|
152
|
-
$ sunlint --typescript --eslint-integration --input=src
|
|
153
|
-
$ sunlint --all --eslint-integration --eslint-merge-rules --input=src
|
|
154
|
-
$ sunlint --all --eslint-integration --eslint-run-after --input=src
|
|
155
|
-
$ sunlint --typescript --eslint-integration --changed-files
|
|
156
|
-
|
|
157
|
-
Advanced File Targeting:
|
|
158
|
-
$ sunlint --all --include="src/**/*.ts,lib/**/*.dart" --exclude="**/*.generated.*" --input=.
|
|
159
|
-
$ sunlint --typescript --exclude="**/*.d.ts,**/*.test.*" --input=src
|
|
160
|
-
$ sunlint --languages=typescript,dart --include="src/**,packages/**" --input=.
|
|
161
|
-
$ sunlint --all --only-source --exclude-tests --languages=typescript --input=.
|
|
162
|
-
|
|
163
|
-
Large Project Optimization:
|
|
164
|
-
$ sunlint --all --input=. --max-semantic-files=500 # Conservative analysis
|
|
165
|
-
$ sunlint --all --input=. --max-semantic-files=2000 # Comprehensive analysis
|
|
166
|
-
$ sunlint --all --input=. --max-semantic-files=-1 # Unlimited (all files)
|
|
167
|
-
$ sunlint --all --input=. --max-semantic-files=0 # Disable semantic analysis
|
|
168
|
-
$ sunlint --all --changed-files --max-semantic-files=300 # Fast CI analysis
|
|
169
|
-
|
|
170
|
-
Architecture Analysis:
|
|
171
|
-
$ sunlint --all --architecture --input=src # Code quality + architecture
|
|
172
|
-
$ sunlint --architecture --input=src # Architecture only
|
|
173
|
-
$ sunlint --architecture --arch-report --input=src # Generate MD report
|
|
174
|
-
$ sunlint --architecture --arch-patterns=mvvm,layered --input=src
|
|
175
|
-
|
|
176
|
-
Sun* Engineering - Coding Standards Made Simple ☀️
|
|
102
|
+
sunlint --all --input=src # Analyze all rules
|
|
103
|
+
sunlint --rule=C019 --input=src # Single rule
|
|
104
|
+
sunlint --rules=C019,C006 --input=src # Multiple rules
|
|
105
|
+
sunlint --quality --input=src # Quality rules only
|
|
106
|
+
sunlint --security --input=src # Security rules only
|
|
107
|
+
|
|
108
|
+
Git Integration:
|
|
109
|
+
sunlint --all --changed-files --input=. # Changed files only
|
|
110
|
+
sunlint --all --staged-files --input=. # Staged files only
|
|
111
|
+
sunlint --all --diff-base=origin/main # Compare with main
|
|
112
|
+
|
|
113
|
+
GitHub Actions:
|
|
114
|
+
sunlint --all --github-annotate --input=src # PR annotations
|
|
115
|
+
sunlint --all --output-summary=report.json # JSON report for CI
|
|
116
|
+
|
|
117
|
+
Reports:
|
|
118
|
+
sunlint --all --output-html --input=src # Generate HTML report
|
|
119
|
+
sunlint --all --output-html=report.html # Custom HTML filename
|
|
120
|
+
|
|
121
|
+
Architecture:
|
|
122
|
+
sunlint --architecture --input=src # Detect patterns
|
|
123
|
+
sunlint --architecture --arch-report # Generate MD report
|
|
124
|
+
|
|
125
|
+
Impact Analysis:
|
|
126
|
+
sunlint --impact --input=src # Analyze code changes
|
|
127
|
+
sunlint --impact --impact-base=origin/main # Compare with main
|
|
128
|
+
sunlint --impact --impact-report=report.md # Custom output file
|
|
129
|
+
|
|
130
|
+
Performance:
|
|
131
|
+
sunlint --all --performance=fast --input=. # Quick scan
|
|
132
|
+
sunlint --all --max-files=500 --input=. # Limit files
|
|
133
|
+
|
|
134
|
+
☀️ Sun* Engineering - Coding Standards Made Simple
|
|
177
135
|
`);
|
|
178
136
|
|
|
179
137
|
return program;
|
package/core/config-merger.js
CHANGED
|
@@ -180,11 +180,29 @@ class ConfigMerger {
|
|
|
180
180
|
|
|
181
181
|
const result = { ...config };
|
|
182
182
|
const inputPaths = Array.isArray(options.input) ? options.input : [options.input];
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
let currentInclude = result.include || [];
|
|
184
|
+
|
|
185
|
+
// Auto-detect Dart project and add .dart patterns
|
|
186
|
+
const fs = require('fs');
|
|
187
|
+
const path = require('path');
|
|
188
|
+
const isDartProject = inputPaths.some(inputPath => {
|
|
189
|
+
const resolvedPath = path.resolve(inputPath);
|
|
190
|
+
// Check for pubspec.yaml (Dart/Flutter project marker)
|
|
191
|
+
const pubspecPath = path.join(resolvedPath, 'pubspec.yaml');
|
|
192
|
+
// Check for .dart files in the directory
|
|
193
|
+
const hasDartFiles = fs.existsSync(resolvedPath) &&
|
|
194
|
+
fs.statSync(resolvedPath).isDirectory() &&
|
|
195
|
+
fs.readdirSync(resolvedPath).some(f => f.endsWith('.dart'));
|
|
196
|
+
return fs.existsSync(pubspecPath) || hasDartFiles;
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
if (isDartProject && !currentInclude.some(p => p.includes('.dart'))) {
|
|
200
|
+
// Add Dart-specific patterns
|
|
201
|
+
currentInclude = [...currentInclude, '**/*.dart'];
|
|
202
|
+
result.include = currentInclude;
|
|
203
|
+
console.log(chalk.cyan(`🎯 AUTO-DETECT: Dart project detected, added **/*.dart to include patterns`));
|
|
204
|
+
}
|
|
205
|
+
|
|
188
206
|
let needsExpansion = false;
|
|
189
207
|
for (const inputPath of inputPaths) {
|
|
190
208
|
const matchesExisting = currentInclude.some(pattern => {
|
|
@@ -192,15 +210,11 @@ class ConfigMerger {
|
|
|
192
210
|
const match2 = minimatch(inputPath + '/**', pattern);
|
|
193
211
|
const match3 = minimatch('**/' + inputPath, pattern);
|
|
194
212
|
const match4 = minimatch('**/' + inputPath + '/**', pattern);
|
|
195
|
-
|
|
196
|
-
console.log(chalk.gray(` AUTO-EXPANSION: ${inputPath} vs ${pattern}: ${match1 || match2 || match3 || match4}`));
|
|
197
|
-
|
|
198
213
|
return match1 || match2 || match3 || match4;
|
|
199
214
|
});
|
|
200
|
-
|
|
215
|
+
|
|
201
216
|
if (!matchesExisting) {
|
|
202
217
|
needsExpansion = true;
|
|
203
|
-
console.log(chalk.gray(` 🔄 AUTO-EXPANSION: ${inputPath} needs expansion`));
|
|
204
218
|
break;
|
|
205
219
|
}
|
|
206
220
|
}
|
|
@@ -262,10 +276,6 @@ class ConfigMerger {
|
|
|
262
276
|
}
|
|
263
277
|
}
|
|
264
278
|
result.include = expandedInclude;
|
|
265
|
-
|
|
266
|
-
console.log(chalk.gray(`📁 AUTO-EXPANSION: Auto-expanded include patterns: ${expandedInclude.join(', ')}`));
|
|
267
|
-
} else {
|
|
268
|
-
console.log(chalk.gray(`✅ AUTO-EXPANSION: No expansion needed`));
|
|
269
279
|
}
|
|
270
280
|
|
|
271
281
|
return result;
|
|
@@ -125,6 +125,7 @@ const DEFAULT_PERFORMANCE = {
|
|
|
125
125
|
RETRY_DELAY_MS: 1000, // 1s delay between retries
|
|
126
126
|
|
|
127
127
|
// Exclusion patterns for performance
|
|
128
|
+
// Note: **/lib/** removed - Dart projects use lib/ as main source directory
|
|
128
129
|
HIGH_PERFORMANCE_EXCLUDES: [
|
|
129
130
|
'**/node_modules/**',
|
|
130
131
|
'**/.next/**',
|
|
@@ -137,8 +138,6 @@ const DEFAULT_PERFORMANCE = {
|
|
|
137
138
|
'**/*.min.js',
|
|
138
139
|
'**/*.bundle.js',
|
|
139
140
|
'**/vendor/**',
|
|
140
|
-
'**/lib/**',
|
|
141
|
-
'**/libs/**',
|
|
142
141
|
'**/.vscode/**',
|
|
143
142
|
'**/.idea/**',
|
|
144
143
|
'**/tmp/**',
|