Skip to content

Commit 6f5fc21

Browse files
committed
Revert format change
1 parent b0f8c6d commit 6f5fc21

File tree

4 files changed

+2
-61
lines changed

4 files changed

+2
-61
lines changed

rewatch/src/format.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ fn format_files(bsc_exe: &Path, files: Vec<String>, check: bool) -> Result<()> {
9898

9999
if output.status.success() {
100100
let original_content = fs::read_to_string(file)?;
101-
// On Windows, bsc outputs CRLF to stdout (text mode), but files have LF.
102-
// Normalize by removing CR before comparison.
103-
#[cfg(windows)]
104-
let formatted_content = String::from_utf8_lossy(&output.stdout).replace("\r\n", "\n");
105-
#[cfg(not(windows))]
106101
let formatted_content = String::from_utf8_lossy(&output.stdout);
107102
if original_content != formatted_content {
108103
if check {

rewatch/src/watcher.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ async fn async_watch(
502502
cmd::run(a)
503503
}
504504
let timing_total_elapsed = timing_total.elapsed();
505-
let compilation_type = if initial_build { "initial" } else { "incremental" };
506505
if show_progress {
506+
let compilation_type = if initial_build { "initial" } else { "incremental" };
507507
if plain_output {
508508
println!("Finished {compilation_type} compilation")
509509
} else {
@@ -515,13 +515,6 @@ async fn async_watch(
515515
timing_total_elapsed.as_secs_f64()
516516
);
517517
}
518-
} else {
519-
// Always log completion for verbose modes
520-
log::info!(
521-
"Finished {} compilation in {:.2}s",
522-
compilation_type,
523-
timing_total_elapsed.as_secs_f64()
524-
);
525518
}
526519

527520
// Populate mtime cache after build completes
@@ -574,12 +567,6 @@ async fn async_watch(
574567
timing_total_elapsed.as_secs_f64()
575568
);
576569
}
577-
} else {
578-
// Always log completion for verbose modes
579-
log::info!(
580-
"Finished compilation in {:.2}s",
581-
timing_total_elapsed.as_secs_f64()
582-
);
583570
}
584571

585572
// Populate mtime cache after build completes

tests/rewatch_tests/fixture/.gitattributes

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

tests/rewatch_tests/helpers/sandbox.mjs

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
import { execSync } from "node:child_process";
2-
import {
3-
cp,
4-
mkdtemp,
5-
readdir,
6-
readFile,
7-
realpath,
8-
rm,
9-
writeFile,
10-
} from "node:fs/promises";
2+
import { cp, mkdtemp, readdir, realpath, rm } from "node:fs/promises";
113
import { tmpdir } from "node:os";
124
import path, { join } from "node:path";
135
import { fileURLToPath } from "node:url";
@@ -51,29 +43,6 @@ async function assertFixtureClean() {
5143
}
5244
}
5345

54-
/**
55-
* Normalize CRLF to LF in .res and .resi files.
56-
* This is needed on Windows where git checkout may convert line endings
57-
* despite .gitattributes settings, causing the formatter to detect changes.
58-
*/
59-
async function normalizeLineEndings(dir) {
60-
const entries = await readdir(dir, { withFileTypes: true });
61-
for (const entry of entries) {
62-
const fullPath = join(dir, entry.name);
63-
if (entry.isDirectory()) {
64-
if (entry.name !== "node_modules" && entry.name !== ".yarn") {
65-
await normalizeLineEndings(fullPath);
66-
}
67-
} else if (entry.name.endsWith(".res") || entry.name.endsWith(".resi")) {
68-
const content = await readFile(fullPath, "utf8");
69-
const normalized = content.replace(/\r\n/g, "\n");
70-
if (normalized !== content) {
71-
await writeFile(fullPath, normalized);
72-
}
73-
}
74-
}
75-
}
76-
7746
export async function createSandbox() {
7847
// Ensure fixture is clean before copying
7948
await assertFixtureClean();
@@ -85,12 +54,6 @@ export async function createSandbox() {
8554
// Copy the fixture directory to the sandbox
8655
await cp(fixtureDir, realDir, { recursive: true });
8756

88-
// On Windows, git checkout may use CRLF line endings despite .gitattributes.
89-
// Normalize to LF so the formatter doesn't detect spurious changes.
90-
if (process.platform === "win32") {
91-
await normalizeLineEndings(realDir);
92-
}
93-
9457
// Run yarn install to create proper node_modules workspace symlinks.
9558
// rewatch resolves dependencies via node_modules/<pkgName> and checks if
9659
// the canonical path is inside the workspace root (no node_modules segment)

0 commit comments

Comments
 (0)