Skip to content

Different findings locally vs. in CI

When CI is red and you see nothing locally, or the other way around.

CodeCharter is deterministic. When local and CI show different findings, there is a concrete cause. Here are the most common ones.

1. Different CodeCharter versions

The most frequent case. A different version runs in CI than locally.

Check:

codecharter --version

Compare locally and in CI.

Fix: bring both to the same version. Recommendation: pin in CI (see Versioning) and install the same version locally.

2. Different rule configuration

CI sees a different rules/ version than you do locally, because you are working on a branch that does not yet have the change.

Check: run git status locally and check which commit was checked out in CI.

Fix: make sure rules/ and .codecharterignore are committed and that both sides see the same commit.

3. Solution state

CodeCharter uses MSBuild to load the solution. If CI works on a clean checkout with all NuGet packages restored, but you have unsaved changes locally or packages are missing, the model will differ.

Check:

dotnet restore
dotnet build

Fix: run a clean dotnet restore && dotnet build locally before codecharter analyze.

4. Different --fail-on thresholds

You run without arguments locally; CI runs with --fail-on error. Locally you only see the console findings; CI produces a hard failure.

Check: look at your CI config to see which flags are set.

Fix: run locally with the same flags:

codecharter analyze MySolution.sln --fail-on error

5. Platform differences

CodeCharter is platform-deterministic. Same findings on Windows and Linux. If you still see differences, that is a bug. Write to us with a minimal repro.

Debug workflow

If nothing helps, run both with --verbose and diff the logs:

codecharter analyze MySolution.sln --verbose 2> debug-local.log
# CI: same, save log as artifact
diff debug-local.log debug-ci.log | less

In --verbose mode CodeCharter lists:

  • Which configuration is active
  • Which rules are loaded
  • Which suppressions are applied

With the diff, the cause is almost always visible in the first 50 lines of difference.

If you cannot find it

Write to us at [email protected] with your CLI version, the --verbose logs from both sides, and the diff of the findings lists.