Skip to content

[Bug Report] Getting "There were stale violations found, please run packwerk update-todo" even there is no stale violations #369

@kalys

Description

@kalys

Description
I'm getting "There were stale violations found, please run packwerk update-todo" when I run check command againts some files.
For this you have to have one violation in several files.

For example:

# This file contains a list of dependencies that are not part of the long term plan for the
# 'packs/one' package.
# We should generally work to reduce this list over time.
#
# You can regenerate this file using the following command:
#
# bin/packwerk update-todo
---
".":
  "::ApplicationController":
    violations:
    - dependency
    files:
    - packs/one/bar.rb
    - packs/one/baz.rb

To Reproduce

  1. Create a dependency violation in the first file.
  2. Create the same dependency violation in another file within the same package.
  3. Run packwerk update-todo in order to generate package_todo.yml file.
  4. Run packwerk check path/to/the/first_file.rb.

Actual Behaviour

  • Command returns 1 status.
  • Command output contains info about stale violations.
📦 Finished in X.XX seconds

No offenses detected
There were stale violations found, please run `packwerk update-todo`

Expected Behaviour

  • Command returns 0 status
  • Command output has no info about stale violations

Version Information

  • Packwerk: 3.1.0
  • Ruby: 3.2.1

Additional Context
3.0.1 has no this problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions