Skip to content

Commit 14b0fdf

Browse files
committed
Update some dependencies
1 parent a41fce4 commit 14b0fdf

6 files changed

Lines changed: 59 additions & 45 deletions

File tree

Cargo.lock

Lines changed: 44 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ clap = { version = "4.5", features = ["derive", "env"] }
2525
# Serialization
2626
serde = { version = "1.0", features = ["derive"] }
2727
serde_json = "1.0"
28-
toml = "0.8"
28+
toml = "0.9.12"
2929

3030
# XML parsing for Liquibase
31-
quick-xml = "0.31"
31+
quick-xml = "0.39.0"
3232

3333
# Error handling
34-
thiserror = "1.0"
34+
thiserror = "2.0"
3535
anyhow = "1.0"
3636

3737
[dev-dependencies]

bridge/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
</description>
1818

1919
<properties>
20-
<maven.compiler.source>11</maven.compiler.source>
21-
<maven.compiler.target>11</maven.compiler.target>
20+
<maven.compiler.source>17</maven.compiler.source>
21+
<maven.compiler.target>17</maven.compiler.target>
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23-
<liquibase.version>4.25.1</liquibase.version>
24-
<gson.version>2.10.1</gson.version>
23+
<liquibase.version>5.0.1</liquibase.version>
24+
<gson.version>2.13.2</gson.version>
2525
</properties>
2626

2727
<dependencies>

bridge/src/main/java/com/pgmigrationlint/LiquibaseBridge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private static List<ChangesetEntry> processChangelog(String changelogPath) throw
130130
// so we default to 1 if unavailable. The Rust side handles this gracefully.
131131
entry.xml_line = 1;
132132

133-
entry.run_in_transaction = changeSet.getRunInTransaction();
133+
entry.run_in_transaction = changeSet.isRunInTransaction();
134134

135135
entries.add(entry);
136136
}

src/input/liquibase_xml.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ impl Default for ColumnConstraints {
176176
/// `RawMigrationUnit` with SQL generated from its child change elements.
177177
fn parse_changelog_xml(xml: &str, source_path: &Path) -> Result<Vec<RawMigrationUnit>, LoadError> {
178178
let mut reader = Reader::from_str(xml);
179-
reader.trim_text(true);
179+
reader.config_mut().trim_text_start = true;
180+
reader.config_mut().trim_text_end = true;
180181

181182
let mut units: Vec<RawMigrationUnit> = Vec::new();
182183
let mut state = ParseState::Root;
@@ -200,7 +201,7 @@ fn parse_changelog_xml(xml: &str, source_path: &Path) -> Result<Vec<RawMigration
200201
let tag_name = local_name_str(e.name().as_ref());
201202
let attrs = collect_attributes(e)?;
202203
let is_empty = matches!(event, Event::Empty(_));
203-
let current_line = byte_offset_to_line(xml, reader.buffer_position());
204+
let current_line = byte_offset_to_line(xml, reader.buffer_position() as usize);
204205

205206
state = handle_start_tag(
206207
state,
@@ -221,10 +222,7 @@ fn parse_changelog_xml(xml: &str, source_path: &Path) -> Result<Vec<RawMigration
221222
state = handle_end_tag(state, &tag_name, source_path, &mut units)?;
222223
}
223224
Event::Text(ref e) => {
224-
let text = e.unescape().map_err(|err| LoadError::Parse {
225-
path: source_path.to_path_buf(),
226-
message: format!("XML text unescape error: {}", err),
227-
})?;
225+
let text = String::from_utf8_lossy(e.as_ref());
228226
state = handle_text(state, &text);
229227
}
230228
Event::CData(ref e) => {
@@ -787,7 +785,8 @@ fn byte_offset_to_line(xml: &str, offset: usize) -> usize {
787785
/// Extract `<include file="..."/>` paths from the XML, resolved relative to the parent file.
788786
fn extract_include_paths(xml: &str, source_path: &Path) -> Result<Vec<PathBuf>, LoadError> {
789787
let mut reader = Reader::from_str(xml);
790-
reader.trim_text(true);
788+
reader.config_mut().trim_text_start = true;
789+
reader.config_mut().trim_text_end = true;
791790
let mut buf = Vec::new();
792791
let mut paths = Vec::new();
793792

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const DEFAULT_CONFIG_FILE: &str = "pg-migration-lint.toml";
2626

2727
#[derive(Parser, Debug)]
2828
#[command(name = "pg-migration-lint")]
29-
#[command(about = "Static analyzer for PostgreSQL migration files", long_about = None)]
29+
#[command(about = "Static analyzer for PostgreSQL migration files", long_about = None, version)]
3030
struct Args {
3131
/// Path to configuration file
3232
#[arg(short, long)]

0 commit comments

Comments
 (0)