Skip to content

Commit

Permalink
Always comment when Squawk checks a file (#330)
Browse files Browse the repository at this point in the history
Previously we would only add or update a comment if violations found. In cases where violations were resolved, this would leave stale warnings in comments.

Now we will always comment as long as files are found and checked.

There is a slight edge case where if a file is no longer in the pull request, the comment won't be updated.

related: #326
  • Loading branch information
chdsbd authored Dec 13, 2023
1 parent 2133edb commit 7417733
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## v0.26.0 - 2023-12-12

### Changed

- `squawk upload-to-github` will always leave a pull request comment if files are evaluated. Previously if violations were resolved, stale warnings would be left in a comment. (#330)

## v0.25.0 - 2023-12-09

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "squawk"
version = "0.25.0"
version = "0.26.0"
authors = ["Steve Dignam <[email protected]>"]
edition = "2018"
license = "GPL-3.0"
Expand Down
4 changes: 3 additions & 1 deletion cli/src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ pub fn check_and_comment_on_pr(
pg_version,
assume_in_transaction,
)?;
if file_results.is_empty() {

// We should only leave a comment when there are files checked.
if paths.is_empty() {
info!("no files checked, exiting");
return Ok(());
}
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
squawk = final.rustPlatform.buildRustPackage {
pname = "squawk";
version = "0.25.0";
version = "0.26.0";

cargoLock = {
lockFile = ./Cargo.lock;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "squawk-cli",
"version": "0.25.0",
"version": "0.26.0",
"description": "linter for PostgreSQL, focused on migrations",
"repository": "[email protected]:sbdchd/squawk.git",
"author": "Steve Dignam <[email protected]>",
Expand Down

0 comments on commit 7417733

Please sign in to comment.