Skip to content

Conversation

@StevenTCramer
Copy link
Contributor

Summary

  • Fixed TW0003 file name analyzer to properly read excluded_files from file-specific editorconfig settings
  • Changed behavior to merge configured exclusions with defaults instead of replacing them
  • Added missing default exclusions for common generated files

Changes

  1. Fixed editorconfig reading: Changed from GlobalOptions to file-specific options using configOptions.GetOptions(tree)
  2. Merge exclusions: Now merges user-configured exclusions with built-in defaults instead of replacing them
  3. Added default exclusions:
    • *.AssemblyInfo.cs (to complement existing *AssemblyInfo.cs)
    • *.AssemblyAttributes.cs
    • *.GlobalUsings.g.cs
  4. Code style fixes: Fixed all analyzer warnings (explicit types, simplified namespace)
  5. Updated test project: Simplified test .editorconfig to only specify additional exclusions

Test plan

  • Build test project with TW0003 enabled - no errors
  • Remove PascalCaseTest.cs exclusion - correctly shows error
  • Re-add exclusion - builds successfully
  • All generated files are properly excluded by default

🤖 Generated with Claude Code

StevenTCramer and others added 6 commits August 3, 2025 01:14
- Move task 015 into folder structure with temporary code fix implementation
- Add required NuGet packages for code fix providers to Directory.Packages.props
- Create task 017 to fix TW0003 analyzer ignoring generated files in obj/bin directories
- Update packages.lock.json for net9.0 target framework

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Let the analyzer use its built-in defaults for file exclusions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Changed from GlobalOptions to file-specific options for reading excluded_files
- Merge configured exclusions with default exclusions instead of replacing
- Added more default exclusions for generated files (*.GlobalUsings.g.cs, *.AssemblyAttributes.cs)
- Fixed code style warnings (explicit types, simplified namespace)
- Test project .editorconfig now only needs to specify additional exclusions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added common terms used in the analyzer:
- assemblyinfo
- buildtransitive
- contentfiles
- nugets

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@StevenTCramer StevenTCramer merged commit 152fbf6 into master Aug 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants