Skip to content

Commit

Permalink
Merge pull request #246 from ricosjp/upgrade-depends-and-clippy
Browse files Browse the repository at this point in the history
Upgrade dependents and fix new clippy
  • Loading branch information
ytanimura authored Sep 19, 2024
2 parents 5411073 + f5d0b25 commit 1dd1e4e
Show file tree
Hide file tree
Showing 26 changed files with 90 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ${{ vars.UBUNTU_VERSION }}
steps:
- uses: actions/checkout@v1
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/esprc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
parse:
runs-on: ubuntu-20.04
runs-on: ${{ vars.UBUNTU_VERSION }}
strategy:
matrix:
ap:
Expand All @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
toolchain: ${{ vars.MSRV }}
profile: minimal
default: true
override: true
Expand All @@ -28,7 +28,7 @@ jobs:
args: --release --bin esprc -- ./schemas/APs/10303-${{ matrix.ap }}-aim-long.exp --check

generate:
runs-on: ubuntu-20.04
runs-on: ${{ vars.UBUNTU_VERSION }}
strategy:
matrix:
ap:
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
toolchain: ${{ vars.MSRV }}
profile: minimal
components: rustfmt
default: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:

jobs:
pages:
runs-on: ubuntu-20.04
runs-on: ${{ vars.UBUNTU_VERSION }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
toolchain: ${{ vars.MSRV }}
profile: minimal
default: true
override: true
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ${{ vars.UBUNTU_VERSION }}
strategy:
matrix:
rust:
- stable
- "1.56.0" # MSRV (for edition 2021)
- ${{ vars.MSRV }}
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
Expand All @@ -30,12 +30,12 @@ jobs:
args: --all-features

check-format:
runs-on: ubuntu-20.04
runs-on: ${{ vars.UBUNTU_VERSION }}
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
toolchain: ${{ vars.MSRV }}
profile: minimal
components: rustfmt
default: true
Expand All @@ -46,12 +46,12 @@ jobs:
args: -- --check

doc:
runs-on: ubuntu-20.04
runs-on: ${{ vars.UBUNTU_VERSION }}
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
toolchain: ${{ vars.MSRV }}
profile: minimal
default: true
override: true
Expand All @@ -61,12 +61,12 @@ jobs:
args: --no-deps

clippy:
runs-on: ubuntu-20.04
runs-on: ${{ vars.UBUNTU_VERSION }}
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
toolchain: ${{ vars.MSRV }}
profile: minimal
components: clippy
default: true
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ In addition to original Keep-a-Changelog, we use following rules:

### Internal
- `cargo upgrade --workspace` https://github.com/ricosjp/ruststep/pull/240
- Upgrading MSRV, updating dependent packages, and supporting the new clippy https://github.com/ricosjp/ruststep/pull/246

## 0.3.0 - 2022-06-14

Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"espr",
"espr-derive",
Expand Down
8 changes: 4 additions & 4 deletions espr-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ categories = ["science", "development-tools"]
proc-macro = true

[dependencies]
quote = "1.0.26"
proc-macro2 = "1.0.53"
syn = { version = "2.0.9", features = ["full", "extra-traits"] }
quote = "1.0.37"
proc-macro2 = "1.0.86"
syn = { version = "2.0.77", features = ["full", "extra-traits"] }

[dependencies.espr]
version = "0.3.0"
Expand All @@ -27,5 +27,5 @@ path = "../espr"
[dev-dependencies]
ruststep = { version = "0.3.0", path = "../ruststep" }
ruststep-derive = { version = "0.3.0", path = "../ruststep-derive" }
serde = "1.0.158"
serde = "1.0.210"
derive-new = "0.5.9"
12 changes: 6 additions & 6 deletions espr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ categories = ["science", "development-tools"]
nom = "7.1.3"

# For Rust code generation
syn = "2.0.9"
quote = "1.0.26"
proc-macro2 = "1.0.53"
syn = "2.0.56"
quote = "1.0.37"
proc-macro2 = "1.0.86"

# Utilities
Inflector = "0.11.4"
derive_more = "0.99.17"
derive_more = "0.99.18"
itertools = "0.10.5"
maplit = "1.0.2"
thiserror = "1.0.40"
thiserror = "1.0.63"
structopt = "0.3.26"
check_keyword = "0.2.0"
katexit = "0.1.4"

[dev-dependencies]
insta = "1.29.0"
insta = "1.39.0"
maplit = "1.0.2"
8 changes: 4 additions & 4 deletions espr/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ pub trait Component: Sized {
}
}

#[macro_export(local_inner_macro)]
#[macro_export(local_inner_macros)]
macro_rules! derive_ast_component {
($component:ty, $parser:path) => {
impl crate::ast::Component for $component {
impl $crate::ast::Component for $component {
fn parse(
input: &str,
) -> Result<(Self, Vec<crate::ast::Remark>), crate::ast::TokenizeFailed> {
) -> Result<(Self, Vec<$crate::ast::Remark>), $crate::ast::TokenizeFailed> {
use nom::Finish;
let input = input.trim();
let (_input, parsed) = $parser(input)
.finish()
.map_err(|err| crate::ast::TokenizeFailed::new(input, err))?;
.map_err(|err| $crate::ast::TokenizeFailed::new(input, err))?;
Ok(parsed)
}
}
Expand Down
1 change: 0 additions & 1 deletion espr/src/codegen/rust/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ mod simple_type;
mod type_decl;
mod type_ref;

pub use entity::*;
pub use format::rustfmt;
pub use schema::*;
8 changes: 4 additions & 4 deletions espr/src/codegen/rust/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ impl Schema {
let name = format_ident!("{}", self.name);
let types = &self.types;
let entities = &self.entities;
let type_decls = self.types.iter().filter(|e| match e {
TypeDecl::Enumeration(_) => false,
_ => true,
});
let type_decls = self
.types
.iter()
.filter(|e| !matches!(e, TypeDecl::Enumeration(_)));
let entity_types: Vec<_> = entities
.iter()
.map(|e| format_ident!("{}", e.name.to_pascal_case()))
Expand Down
11 changes: 5 additions & 6 deletions espr/src/ir/complex_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,16 @@ pub struct PartialComplexEntity {

impl PartialOrd for PartialComplexEntity {
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering> {
match PartialOrd::partial_cmp(&self.indices.len(), &rhs.indices.len()) {
Some(Ordering::Equal) => PartialOrd::partial_cmp(&self.indices, &rhs.indices),
a @ Some(Ordering::Less) | a @ Some(Ordering::Greater) => a,
None => unreachable!(),
}
Some(self.cmp(rhs))
}
}

impl Ord for PartialComplexEntity {
fn cmp(&self, rhs: &Self) -> Ordering {
self.partial_cmp(rhs).unwrap()
match Ord::cmp(&self.indices.len(), &rhs.indices.len()) {
Ordering::Equal => Ord::cmp(&self.indices, &rhs.indices),
a @ Ordering::Less | a @ Ordering::Greater => a,
}
}
}

Expand Down
8 changes: 1 addition & 7 deletions espr/src/ir/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,7 @@ impl PartialOrd for Scope {
return None;
}
}
if self.0.len() == other.0.len() {
Some(cmp::Ordering::Equal)
} else if self.0.len() > other.0.len() {
Some(cmp::Ordering::Less)
} else {
Some(cmp::Ordering::Greater)
}
Some(other.0.len().cmp(&self.0.len()))
}
}

Expand Down
2 changes: 2 additions & 0 deletions espr/src/parser/basis.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::manual_is_ascii_check)]

use super::{combinator::RawParseResult, reserved::is_reserved};
use nom::{branch::*, character::complete::*, multi::*, sequence::*, Parser};

Expand Down
1 change: 1 addition & 0 deletions espr/src/parser/entity/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod attribute;
mod derive;
mod domain;
#[allow(clippy::module_inception)]
mod entity;
mod inverse;
mod unique;
Expand Down
2 changes: 1 addition & 1 deletion espr/src/parser/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub fn procedure_decl(input: &str) -> ParseResult<Procedure> {
/// `)` \] `;` .
pub fn procedure_head(input: &str) -> ParseResult<(String, Vec<FormalParameter>)> {
let param = tuple((opt(tag("VAR")), formal_parameter)).map(|(var, mut params)| {
for mut param in &mut params {
for param in &mut params {
param.is_variable = var.is_some();
}
params
Expand Down
14 changes: 7 additions & 7 deletions ruststep-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ categories = ["science", "development-tools"]
proc-macro = true

[dependencies]
quote = "1.0.26"
proc-macro2 = "1.0.53"
syn = { version = "2.0.9", features = ["full", "extra-traits"] }
proc-macro-crate = "1.2.1"
quote = "1.0.37"
proc-macro2 = "1.0.86"
syn = { version = "2.0.56", features = ["full", "extra-traits"] }
proc-macro-crate = "1.3.0"
Inflector = "0.11.4"
proc-macro-error = "1.0.4"

[dev-dependencies]
serde = "1.0.158"
trybuild = "1.0.80"
insta = "1.29.0"
serde = "1.0.210"
trybuild = "1.0.90"
insta = "1.39.0"

[dev-dependencies.ruststep]
path = "../ruststep"
Expand Down
2 changes: 1 addition & 1 deletion ruststep-derive/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn as_holder_path(input: &syn::Type) -> syn::Type {
.clone()
.try_into()
.expect_or_abort("as_holder! only accepts espr-generated type");
ft.as_holder().into()
ft.into_holder().into()
}

pub fn as_visitor_ident(input: &syn::Ident) -> syn::Ident {
Expand Down
2 changes: 1 addition & 1 deletion ruststep-derive/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl FieldEntries {
}),
FieldType::Boxed(_) => abort_call_site!("Unexpected Box<T>"),
}
holder_types.push(ft.as_holder().as_place_holder().into());
holder_types.push(ft.into_holder().into_place_holder().into());
} else {
into_owned.push(quote! { #ident });
holder_types.push(ft.into());
Expand Down
Loading

0 comments on commit 1dd1e4e

Please sign in to comment.