Skip to content

Commit bcfddaf

Browse files
committed
chore: merge main
2 parents 835f90a + ee0e583 commit bcfddaf

File tree

75 files changed

+1031
-726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1031
-726
lines changed

.cargo/config.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ concurrency:
2020
cancel-in-progress: true
2121

2222
env:
23-
RUSTFLAGS: -A dead_code
2423
RUST_LOG: info
2524
RUST_BACKTRACE: 1
2625
RUSTUP_WINDOWS_PATH_ADD_BIN: 1

.github/workflows/release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ permissions:
77
contents: write
88

99
env:
10-
# Ultimately, we shouldn't ignore warnings.
11-
# We need to pass it as an ENV because inlining doesn't work on Windows.
12-
RUSTFLAGS: -A dead_code
1310
# Need these guys for cross-compilation
1411
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
1512
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"postgrestools.bin": "./target/debug/postgrestools"
3+
}

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ serde = "1.0.195"
3939
serde_json = "1.0.114"
4040
similar = "2.6.0"
4141
smallvec = { version = "1.13.2", features = ["union", "const_new", "serde"] }
42+
strum = { version = "0.27.1", features = ["derive"] }
4243
# this will use tokio if available, otherwise async-std
4344
sqlx = { version = "0.8.2", features = ["runtime-tokio", "runtime-async-std", "postgres", "json"] }
4445
syn = "1.0.109"
@@ -57,7 +58,6 @@ pgt_analyse = { path = "./crates/pgt_analyse", version = "0.0.0"
5758
pgt_analyser = { path = "./crates/pgt_analyser", version = "0.0.0" }
5859
pgt_base_db = { path = "./crates/pgt_base_db", version = "0.0.0" }
5960
pgt_cli = { path = "./crates/pgt_cli", version = "0.0.0" }
60-
pgt_commands = { path = "./crates/pgt_commands", version = "0.0.0" }
6161
pgt_completions = { path = "./crates/pgt_completions", version = "0.0.0" }
6262
pgt_configuration = { path = "./crates/pgt_configuration", version = "0.0.0" }
6363
pgt_console = { path = "./crates/pgt_console", version = "0.0.0" }

crates/pgt_analyse/src/rule.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,6 @@ impl RuleDiagnostic {
260260
self.footer(LogCategory::Warn, msg)
261261
}
262262

263-
pub(crate) fn span(&self) -> Option<TextRange> {
264-
self.span
265-
}
266-
267263
pub fn advices(&self) -> &RuleAdvice {
268264
&self.rule_advice
269265
}

crates/pgt_cli/src/commands/check.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ impl CommandRunner for CheckCommandPayload {
6161
self.stdin_file_path.as_deref()
6262
}
6363

64-
fn should_write(&self) -> bool {
65-
false
66-
}
67-
6864
fn get_execution(
6965
&self,
7066
cli_options: &CliOptions,

crates/pgt_cli/src/commands/daemon.rs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::{
55
use pgt_console::{ConsoleExt, markup};
66
use pgt_lsp::ServerFactory;
77
use pgt_workspace::{TransportError, WorkspaceError, workspace::WorkspaceClient};
8-
use std::{env, fs, path::PathBuf};
8+
use std::{env, path::PathBuf};
99
use tokio::io;
1010
use tokio::runtime::Runtime;
1111
use tracing::subscriber::Interest;
@@ -175,33 +175,6 @@ async fn start_lsp_proxy(
175175
}
176176
}
177177

178-
pub(crate) fn read_most_recent_log_file(
179-
log_path: Option<PathBuf>,
180-
log_file_name_prefix: String,
181-
) -> io::Result<Option<String>> {
182-
let pgt_log_path = log_path.unwrap_or(default_pgt_log_path());
183-
184-
let most_recent = fs::read_dir(pgt_log_path)?
185-
.flatten()
186-
.filter(|file| file.file_type().is_ok_and(|ty| ty.is_file()))
187-
.filter_map(|file| {
188-
match file
189-
.file_name()
190-
.to_str()?
191-
.split_once(log_file_name_prefix.as_str())
192-
{
193-
Some((_, date_part)) if date_part.split('-').count() == 4 => Some(file.path()),
194-
_ => None,
195-
}
196-
})
197-
.max();
198-
199-
match most_recent {
200-
Some(file) => Ok(Some(fs::read_to_string(file)?)),
201-
None => Ok(None),
202-
}
203-
}
204-
205178
/// Set up the [tracing]-based logging system for the server
206179
/// The events received by the subscriber are filtered at the `info` level,
207180
/// then printed using the [HierarchicalLayer] layer, and the resulting text

crates/pgt_cli/src/commands/mod.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use pgt_workspace::workspace::UpdateSettingsParams;
1515
use pgt_workspace::{DynRef, Workspace, WorkspaceError};
1616
use std::ffi::OsString;
1717
use std::path::PathBuf;
18-
1918
pub(crate) mod check;
2019
pub(crate) mod clean;
2120
pub(crate) mod daemon;
@@ -24,6 +23,7 @@ pub(crate) mod version;
2423

2524
#[derive(Debug, Clone, Bpaf)]
2625
#[bpaf(options, version(VERSION))]
26+
#[allow(clippy::large_enum_variant)]
2727
/// Postgres Tools official CLI. Use it to check the health of your project or run it to check single files.
2828
pub enum PgtCommand {
2929
/// Shows the version information and quit.
@@ -338,9 +338,6 @@ pub(crate) trait CommandRunner: Sized {
338338
/// It returns the file path to use in `stdin` mode.
339339
fn get_stdin_file_path(&self) -> Option<&str>;
340340

341-
/// Whether the command should write the files.
342-
fn should_write(&self) -> bool;
343-
344341
/// Returns the [Execution] mode.
345342
fn get_execution(
346343
&self,
@@ -357,11 +354,6 @@ pub(crate) trait CommandRunner: Sized {
357354
fn check_incompatible_arguments(&self) -> Result<(), CliDiagnostic> {
358355
Ok(())
359356
}
360-
361-
/// Checks whether the configuration has errors.
362-
fn should_validate_configuration_diagnostics(&self) -> bool {
363-
true
364-
}
365357
}
366358

367359
fn get_files_to_process_with_cli_options(

0 commit comments

Comments
 (0)