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

fix: build script new line at eof #3353

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

Zarthus
Copy link
Contributor

@Zarthus Zarthus commented Jul 17, 2024

When generating the build script, it will fail cargo fmt -- --check because it is missing a new line at the end of the file.

Does your PR solve an issue?

There is no existing issue for this, I thought the fix was easy enough that it was best discussed in a MR :) I'm happy to create an issue for this to link to if that is preferable.

What's the problem?

When running sqlx migrate build-script CLI, it fails cargo-fmt. cargo-fmt suggests adding a newline at EOF. This was found because our CI runs cargo fmt as a CI step and it failed :)

Existing behaviour:

~/Projects/sqlx/sqlx-cli $ cargo run -- migrate build-script                      
   Compiling sqlx-cli v0.8.0-alpha.0 (/Users/jahrens/Projects/sqlx/sqlx-cli)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.36s
     Running `/Users/jahrens/Projects/sqlx/target/debug/sqlx migrate build-script`
Created `build.rs`; be sure to check it into version control!

~/Projects/sqlx/sqlx-cli $ cargo fmt -- --check                                  
Diff in /Users/jahrens/Projects/sqlx/sqlx-cli/build.rs at line 3:
     // trigger recompilation when a new migration is added
     println!("cargo:rerun-if-changed=migrations");
 }
+

Fixed behaviour

~/Projects/sqlx/sqlx-cli $ cargo run -- migrate build-script                                             Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.15s
     Running `/Users/jahrens/Projects/sqlx/target/debug/sqlx migrate build-script`
Created `build.rs`; be sure to check it into version control!

~/Projects/sqlx/sqlx-cli $ cargo fmt -- --check                                                      

When generating the build script, it will
fail `cargo fmt -- --check` because it is
missing a new line at the end of the file.
@abonander abonander merged commit 543395d into launchbadge:main Jul 19, 2024
65 checks passed
jrasanen pushed a commit to jrasanen/sqlx that referenced this pull request Oct 14, 2024
When generating the build script, it will
fail `cargo fmt -- --check` because it is
missing a new line at the end of the file.
jrasanen pushed a commit to jrasanen/sqlx that referenced this pull request Oct 14, 2024
When generating the build script, it will
fail `cargo fmt -- --check` because it is
missing a new line at the end of the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants