Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Stale violations on deleted files #298

Closed
gmcgibbon opened this issue Jan 30, 2023 · 1 comment · Fixed by #332
Closed

[Bug Report] Stale violations on deleted files #298

gmcgibbon opened this issue Jan 30, 2023 · 1 comment · Fixed by #332
Assignees
Labels
bug Something isn't working

Comments

@gmcgibbon
Copy link
Member

Description
Stale violations in deleted files aren't deleted.

To Reproduce
If you update a package TODO, delete the file that has the reference violation, and then run packwerk check, it will pass.

Expected Behaviour
It should fail, but packwerk doesn't inspect that file anymore and can't see that there are stale references in the TODO file.

Version Information

  • Packwerk: edge
  • Ruby v3.2.0

Additional Context
I think it might be useful to add CLI options to check and update that take deleted file violations into consideration. Right now, you have to do something like

unless Packwerk::Cli.new(style: Packwerk::OutputStyles::Coloured.new).execute_command(["check"])
  exit(1)
end

Packwerk::Cli.new(style: Packwerk::OutputStyles::Coloured.new).execute_command(["update-deprecations"])

unless %x(git status --porcelain).empty?
  puts <<~MESSAGE
    There were stale violations found, please run `packwerk update-deprecations`.
  MESSAGE
  exit(1)
end

which isn't ideal.

@gmcgibbon gmcgibbon added the bug Something isn't working label Jan 30, 2023
@AlbertGazizov
Copy link

Guys, any plans to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants