fix: display of file names

This commit is contained in:
Shunsuke Shibayama 2023-03-15 18:14:56 +09:00
parent 0576749bfe
commit 5c36232696
4 changed files with 14 additions and 18 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
/target
__pycache__/
test.py
test*.py

12
Cargo.lock generated
View File

@ -253,8 +253,7 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
[[package]]
name = "els"
version = "0.1.20-nightly.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b8142d4e705b2d806507ec6846b7e98cc05264575bb468d6340d3ea829b04e9"
source = "git+https://github.com/erg-lang/erg?branch=main#7adaecdfbb64d16c7e843cf45eee547afd42da0f"
dependencies = [
"erg_common",
"erg_compiler",
@ -275,8 +274,7 @@ dependencies = [
[[package]]
name = "erg_common"
version = "0.6.8-nightly.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97d908333ab5bf78564b97716c2da08d24352b7d3a0d3b1ea30ad9c0776ab75d"
source = "git+https://github.com/erg-lang/erg?branch=main#7adaecdfbb64d16c7e843cf45eee547afd42da0f"
dependencies = [
"backtrace-on-stack-overflow",
"hermit-abi",
@ -287,8 +285,7 @@ dependencies = [
[[package]]
name = "erg_compiler"
version = "0.6.8-nightly.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cce5bba39e948a788ab06cda865d15258b5533c1d31150964f998d28eb82c49a"
source = "git+https://github.com/erg-lang/erg?branch=main#7adaecdfbb64d16c7e843cf45eee547afd42da0f"
dependencies = [
"erg_common",
"erg_parser",
@ -297,8 +294,7 @@ dependencies = [
[[package]]
name = "erg_parser"
version = "0.6.8-nightly.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22056c06206be2ecebe12fcd07609b4413db216acdbc4099fe5453becd7581df"
source = "git+https://github.com/erg-lang/erg?branch=main#7adaecdfbb64d16c7e843cf45eee547afd42da0f"
dependencies = [
"erg_common",
"unicode-xid 0.2.4",

View File

@ -22,13 +22,13 @@ edition = "2021"
repository = "https://github.com/mtshiba/pylyzer"
[workspace.dependencies]
erg_common = { version = "0.6.8-nightly.1", features = ["py_compatible", "els"] }
erg_compiler = { version = "0.6.8-nightly.1", features = ["py_compatible", "els"] }
els = { version = "0.1.20-nightly.1", features = ["py_compatible"] }
# erg_common = { version = "0.6.8-nightly.1", features = ["py_compatible", "els"] }
# erg_compiler = { version = "0.6.8-nightly.1", features = ["py_compatible", "els"] }
# els = { version = "0.1.20-nightly.1", features = ["py_compatible"] }
rustpython-parser = "0.1.2"
# erg_compiler = { git = "https://github.com/erg-lang/erg", branch = "main", features = ["py_compatible", "els"] }
# erg_common = { git = "https://github.com/erg-lang/erg", branch = "main", features = ["py_compatible", "els"] }
# els = { git = "https://github.com/erg-lang/erg", branch = "main", features = ["py_compatible"] }
erg_compiler = { git = "https://github.com/erg-lang/erg", branch = "main", features = ["py_compatible", "els"] }
erg_common = { git = "https://github.com/erg-lang/erg", branch = "main", features = ["py_compatible", "els"] }
els = { git = "https://github.com/erg-lang/erg", branch = "main", features = ["py_compatible"] }
[features]
debug = ["erg_compiler/debug", "erg_common/debug", "py2erg/debug"]

View File

@ -142,7 +142,7 @@ impl PythonAnalyzer {
println!(
"{YELLOW}Found {} warnings{RESET}: {}",
artifact.warns.len(),
self.cfg.input.filename()
self.cfg.input.unescaped_filename()
);
artifact.warns.fmt_all_stderr();
}
@ -165,7 +165,7 @@ impl PythonAnalyzer {
println!(
"{YELLOW}Found {} warnings{RESET}: {}",
artifact.warns.len(),
self.cfg.input.filename()
self.cfg.input.unescaped_filename()
);
artifact.warns.fmt_all_stderr();
}
@ -179,7 +179,7 @@ impl PythonAnalyzer {
println!(
"{RED}Found {} errors{RESET}: {}",
artifact.errors.len(),
self.cfg.input.filename()
self.cfg.input.unescaped_filename()
);
artifact.errors.fmt_all_stderr();
1