Conversation
- Add Suppression class to parse shield_ignore comments - Support line-level and file-level suppression - Add toUnderscoreCase() method to RuleId enum - Handle underscore format rule IDs for consistency
- Add RuleConfig class for parsing string and object rule formats - Update LintRuleConverter to handle dynamic rule configurations - Support per-rule exclude patterns in configuration - Regenerate shield_config.g.dart with build_runner
- Add suppression checking in SecurityAnalyzer._analyzeUnit() - Implement file exclusion check in LintRule.check() method - Update LintIssue to use underscore format rule IDs - Support three-layer filtering: global, per-rule, and line-level
- Add unit tests for Suppression class parsing - Test line-level and file-level suppression - Test multiple rule suppression in single comment - Add integration test data file with example suppressions
- Add tests for mixed format rule configuration parsing - Update existing tests to use underscore format rule IDs - Test string and object format rule configurations - Fix prefer_secure_random_test to expect correct rule ID format
- Update example shield_options.yaml with mixed format rules - Include per-rule exclude patterns in configuration - Add comment examples showing new syntax
- Add comprehensive test reorganization plan document - Create test/fixtures/ directory with sample Dart files and configs - Create test/helpers/ directory with test utilities - Add TestAnalyzer helper for AST analysis in tests - Add MockWorkspace helper for workspace mocking - Add TestDataBuilder helper for test data generation - Add sample vulnerable, secure, and mixed code files - Add sample configuration files (minimal, complete, invalid) - Add suppression example file for testing
- Add RuleId enum tests covering fromYamlName and toUnderscoreCase methods - Add Severity enum tests covering values, analysisSeverity mapping, and comparison - Add RuleStatus enum tests covering lifecycle status management - Test edge cases, error handling, and enum integrity - Ensure 100% coverage for all enum types
- Add MatchingPattern tests covering constructor, regex property, fromJson factory - Add ShieldSecrets tests covering constructor, containsSecret method, YAML parsing - Add LintIssue tests covering constructor, withRule factory, JSON serialization - Test error handling, edge cases, and property validation - Ensure 100% coverage for all model classes
- Add RuleRegistry tests covering rule creation, registration, and immutability - Add Workspace tests covering path normalization, config management, and file operations - Test rule creation consistency and property validation - Test workspace edge cases including parent directory references - Ensure comprehensive coverage for core security analyzer components
- Move configuration tests to test/unit/security_analyzer/configuration/ - Move utility tests to test/unit/security_analyzer/utils/ and test/unit/utils/ - Update import paths to use new fixtures directory structure - Fix type inference issues in test files - Maintain all existing test functionality while improving organization
- Move prefer_secure_random_test.dart to test/unit/security_analyzer/rules/rules_list/crypto/ - Maintain all existing test functionality - Improve test organization by categorizing security rules
- Remove old test/data/ directory files - Remove old test/src/ directory structure - Complete migration to new test organization structure - All tests now properly organized in unit/, fixtures/, and helpers/ directories
BREAKING CHANGE: Configuration fields and rule names now use snake_case instead of kebab-case. - Change FieldRename from kebab to snake in configuration classes - Update RuleId.fromYamlName() to parse snake_case instead of kebab-case - Update error messages to use snake_case field names - Update rule config documentation examples This aligns the configuration format with Dart's analysis_options.yaml conventions.
Update generated files to use snake_case field names instead of kebab-case.
- Simplify suppression canonicalization to remove kebab-case compatibility - Update default config template to use snake_case rule names - Update suppression comments to use snake_case format
- Update example/shield_options.yaml to use snake_case format - Update README.md configuration examples - Align documentation with new snake_case naming convention
- Update all YAML test fixtures to use snake_case format - Update inline config strings in test helpers - Ensure tests use the new snake_case naming convention
- Update lint rule converter tests to expect snake_case rule names - Update rule ID tests to parse snake_case instead of kebab-case - Update suppression tests to use snake_case format - Update workspace tests to expect snake_case in default config - Remove backward compatibility tests for kebab-case
Document the breaking change from kebab-case to snake_case configuration format. Includes detailed migration guide for all affected configuration fields and rule names.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
READY
Description
Closes #11 and #14
Type of Change