Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
79 lines (75 loc) · 7.8 KB
/
Copy pathDirectory.Build.props
File metadata and controls
79 lines (75 loc) · 7.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<Project>
<PropertyGroup>
<Copyright>Copyright © 2025-$([System.DateTime]::Now.Year) Aaron Stannard</Copyright>
<Authors>Aaron Stannard</Authors>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<VersionPrefix>0.5.0</VersionPrefix>
<PackageReleaseNotes>**Features:**
* New rule **SW021 — Dynamic Keyword Ban**. Flags any use of the `dynamic` keyword at error severity. Dynamic bypasses compile-time type checking, defeats static analysis, breaks trimming/AOT, and is a common LLM escape hatch for silencing type errors instead of fixing them (#139)
* Generated code is now skipped by default — files with an `<auto-generated>` header or a generated filename (`*.g.cs`, `*.Designer.cs`, `*.generated.cs`, `*.g.i.cs`, `TemporaryGeneratedFile_*`) are no longer analyzed. These are the same signals Roslyn's analyzers use, so slopwatch skips what the compiler skips (#141)
* `[GeneratedCode]` / `[DebuggerNonUserCode]` attribute detection is available as an opt-in via `generatedCode.detectAttributes`. It is off by default because attribute identity cannot be resolved without a compilation, and a wrong answer would silently drop hand-written findings (#141)
* New `generatedCode` section in `.slopwatch/config.json` with `skip` (default), `analyze`, and `analyzeAndReport` modes. `init` and `analyze` both honor it (#141)
* Generated filename patterns (`*.g.cs`, `*.Designer.cs`, `*.generated.cs`, `*.g.i.cs`) are no longer in the default exclude list — the `generatedCode` mode now owns that decision, so `analyze` mode can reach those files (#141)
* `analyzeAndReport` findings carry `isGeneratedCode` in JSON output and a `[generated]` marker in console output (#141)
* `--update-baseline` now preserves baseline entries for files skipped entirely as generated code, so changing modes later does not resurface a wall of findings. Files that are analyzed with individual generated findings filtered out are pruned normally (#141)
**Behavior Changes:**
* **SW021 is on by default at error severity, and there is no way to disable a rule.** There is no rule-filter flag and no config key for rule enablement — only `[SlopwatchSuppress]` or baselining. Combined with `--fail-on error` (the default) and hook mode failing on warnings, **any codebase that uses `dynamic` will start failing CI and blocking edits on upgrade.** If that is not what you want, baseline the existing occurrences before upgrading (#139)
* Generated files that were previously analyzed are now skipped by default. If you rely on findings in generated files, set `generatedCode.mode` to `analyze` or `analyzeAndReport` (#141)
* **Baseline schema is now version 2, and existing baselines must be regenerated.** SW001–SW006 entries used to hash on the display snippet, so two identical occurrences in one file collapsed to a single identity and baselining one silently exempted the other. Entries now hash on a structural path. A version 1 baseline cannot match the new hashes, so `analyze` stops before running and tells you to regenerate (#142):
```
slopwatch init --force
```
Review the regenerated `.slopwatch/baseline.json` before committing it. A baseline with no `version` property at all is treated as version 1 and rejected the same way. If you run `analyze` with a custom `--baseline` path, the error names that path and the remedy becomes `slopwatch init --force --baseline <path>` — `init` now accepts `--baseline` so it can regenerate the file that actually failed. A real migration path — recording which identity scheme produced each entry — is tracked by #107.
* Baseline churn increases: adding or reordering sibling declarations changes the group fingerprint and invalidates those entries. This is deliberate — it rejects false exemptions rather than silently carrying them forward (#142)
**Bug Fixes:**
* Nested git worktrees are now skipped structurally instead of by directory name. The default exclude list contained `**/worktrees/**`, which skipped **any** directory named `worktrees` — including ordinary source — and reported a clean scan for code it never read. A project keeping source under `worktrees/` got `0 files analyzed` and exit 0. Detection now identifies a linked worktree by Git's administrative layout: a `.git` file whose gitdir carries both a `commondir` file and a reciprocal `gitdir` pointer. Submodules and `git init --separate-git-dir` checkouts also use `.git` files but carry neither, so their source is analyzed (#99, #158)
* SW021 no longer flags `using dynamic;` and `using static dynamic;`. A using directive's name is a namespace-or-type reference, never a dynamic-typed slot, so both were false positives. `using D = dynamic;` still reports — that aliases the builtin type and is a genuine dynamic slot (#143)
* SW001 no longer reports a method in the active `#else` or `#elif` branch of an `#if false` block as disabled (#142)
* `[SlopwatchSuppress]` now works on lambdas. It was silently ignored because the suppression checker had no lambda case (#139)
* `[SlopwatchSuppress]` is now valid on `struct`, `interface`, `constructor`, `delegate`, `event`, `enum`, destructor, indexer, operator, conversion operator, local function, and accessor. These were compile errors before (#139)
* `init --config` now forwards the config path to the suppression checker, so suppressions declared in the selected config are honored (#141)
* `init` now honors the `generatedCode` config, so the baseline it writes agrees with the next `analyze` run (#141)
**Performance:**
* SW021 identity generation is now linear in dynamic occurrence count instead of quadratic. Sibling-group fingerprints and structural path segments are memoized per analysis call, so a file with many `dynamic` occurrences no longer rehashes every sibling and rebuilds every ancestor segment per occurrence (#144)
* Structural path caching for SW001–SW006. XML identities dropped from 57 GB to 30 MB at 2,000 findings, and named-method siblings from 3.47 GB / 6.4 s to 2 MB (#142)
* Baseline creation is now linear. `AddEntry` invalidated the hash lookup after every insertion, which was quadratic in entry count (#142)
**Dependencies:**
* Bumped Microsoft.CodeAnalysis.CSharp from 5.3.0 to 5.6.0
* Bumped Microsoft.Extensions.FileSystemGlobbing from 8.0.0 to 10.0.9
* Bumped Microsoft.SourceLink.GitHub from 8.0.0 to 10.0.301
* Bumped Microsoft.NET.Test.Sdk from 18.0.1 to 18.9.0
* Bumped Akka.Streams from 1.5.68 to 1.5.74
* Bumped dotnet-sdk from 10.0.300 to 10.0.401
* Bumped actions/checkout from 6.0.2 to 7.0.1
* Bumped actions/setup-dotnet from 5.3.0 to 6.0.0
* Bumped codecov/codecov-action from 6 to 7
* Bumped incrementalist.cmd from 1.2.1 to 1.2.2</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup>
<!-- Target framework versions -->
<NetCoreVersion>net8.0</NetCoreVersion>
<NetCoreTestVersion>net8.0</NetCoreTestVersion>
</PropertyGroup>
<!-- GitHub SourceLink -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>
<!-- NuGet package properties -->
<PropertyGroup>
<PackageTags>slopwatch;llm;code-quality;linter;dotnet-tool;ai-safety</PackageTags>
<PackageProjectUrl>https://github.com/Aaronontheweb/dotnet-slopwatch</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>logo.png</PackageIcon>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\README.md" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)\images\logo.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>