Skip to content

Commit

Permalink
Update dependencies, Clippy fixes, add Nix flake (#97)
Browse files Browse the repository at this point in the history
* updates

* updates

* updates

* updates

* updates
  • Loading branch information
yoav-lavi authored Nov 24, 2024
1 parent 1420616 commit c2eaf8f
Show file tree
Hide file tree
Showing 20 changed files with 254 additions and 124 deletions.
2 changes: 2 additions & 0 deletions .envrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use flake
dotenv_if_exists .env
8 changes: 3 additions & 5 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown,x86_64-unknown-linux-gnu
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
- name: Clippy
run: cargo clippy --all-targets --all-features
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown,x86_64-unknown-linux-gnu
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
**.vsix
.DS_Store
.idea
.vscode
.vscode
.direnv
88 changes: 58 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[workspace]
members = [
"crates/melody_cli",
"crates/melody_compiler",
"crates/melody_wasm",
"xtask",
"crates/melody_cli",
"crates/melody_compiler",
"crates/melody_wasm",
"xtask",
]
resolver = "2"

Expand Down
24 changes: 11 additions & 13 deletions crates/melody_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,25 @@ repository = "https://github.com/yoav-lavi/melody"
readme = "README.md"
version = "0.19.0"
edition = "2021"
rust = "1.65.0"
license = "MIT OR Apache-2.0"
keywords = ["melody", "melodylang", "language", "cli"]
categories = ["command-line-utilities"]

[dependencies]
clap = { version = "4.1.4", features = ["derive"] }
colored = "2.0.0"
thiserror = "1.0.31"
anyhow = "1.0.58"
clap = { version = "4", features = ["derive"] }
colored = "2"
thiserror = "2"
anyhow = "1"
melody_compiler = { version = "0.19.0", path = "../melody_compiler" }
atty = "0.2.14"
exitcode = "1.1.2"
clap_complete = "4.1.1"
regress = "0.6.0"
exitcode = "1"
clap_complete = "4"
regress = "0.10"

[dev-dependencies]
assert_cmd = "2.0.4"
assert_fs = "1.0.7"
unindent = "0.2.2"
tempfile = "3.3.0"
assert_cmd = "2"
assert_fs = "1"
unindent = "0.2"
tempfile = "3"

[[bin]]
name = "melody"
Expand Down
2 changes: 1 addition & 1 deletion crates/melody_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn main() {
ShouldColorize::from_env();

match try_main() {
Ok(_) => process::exit(exitcode::OK),
Ok(()) => process::exit(exitcode::OK),
Err(error) => handle_error(&error),
};
}
Expand Down
8 changes: 4 additions & 4 deletions crates/melody_cli/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use atty::Stream;
use clap::Parser;
use std::io::IsTerminal;

#[derive(Parser, Debug)]
#[clap(about, version, author)]
Expand Down Expand Up @@ -61,9 +61,9 @@ pub struct Streams {
impl Streams {
pub fn new() -> Self {
Self {
stdin: !atty::is(Stream::Stdin),
stdout: !atty::is(Stream::Stdout),
// stderr: !atty::is(Stream::Stderr),
stdin: !std::io::stdin().is_terminal(),
stdout: !std::io::stdout().is_terminal(),
// stderr: !std::io::stderr().is_terminal(),
}
}
pub const fn any_pipe(&self) -> bool {
Expand Down
15 changes: 7 additions & 8 deletions crates/melody_compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ repository = "https://github.com/yoav-lavi/melody"
readme = "README.md"
version = "0.19.0"
edition = "2021"
rust = "1.65.0"
license = "MIT OR Apache-2.0"
keywords = ["melody", "melodylang", "language", "compiler"]
categories = ["compilers"]
Expand All @@ -15,15 +14,15 @@ categories = ["compilers"]
fuzzer = ["arbitrary"]

[dependencies]
pest = "2.1.3"
pest_derive = "2.1.0"
once_cell = "1.12.0"
arbitrary = { version = "1.1.3", features = ["derive"], optional = true }
thiserror = "1.0.31"
pest = "2"
pest_derive = "2"
once_cell = "1"
arbitrary = { version = "1", features = ["derive"], optional = true }
thiserror = "2"

[dev-dependencies]
criterion = "0.5.1"
indoc = "2.0.3"
criterion = "0.5"
indoc = "2"

[[bench]]
name = "benchmark"
Expand Down
2 changes: 1 addition & 1 deletion crates/melody_compiler/src/ast/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub fn unquote_escape_literal(pair: &Pair<'_, Rule>) -> String {

match quote_type {
'"' => literal.replace(r#"\""#, r#"""#),
'\'' => literal.replace(r#"\'"#, r#"'"#),
'\'' => literal.replace(r"\'", r"'"),
_ => unreachable!(),
}
}
Expand Down
Loading

0 comments on commit c2eaf8f

Please sign in to comment.