Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit_reexport_of_matching_names test case. #100

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a260c15
Release v23.1.0. (#21)
obi1kenobi Jan 5, 2023
5aaf30e
Use the Swatinem/rust-cache@v2 action for caching. (#26) (#27)
obi1kenobi Jan 6, 2023
c075f09
Add fields to Variant interface (#32)
staniewzki Jan 6, 2023
a94ac93
Support renaming re-exports, glob re-exports, and type aliases used a…
obi1kenobi Jan 27, 2023
4b92627
Rely on the test crates instead of the manually-generated file. (#49)
obi1kenobi Jan 27, 2023
7dacacf
Release v23.2.0 with imports revamp. (#51)
obi1kenobi Jan 27, 2023
a0d35a1
Support omitting defaulted generic parameters. (#52) (#53)
obi1kenobi Jan 31, 2023
217e9f9
Release v23.2.1. (#57)
obi1kenobi Jan 31, 2023
75fc902
Add a test case where a type and a value have the same name. (#60) (#63)
obi1kenobi Jan 31, 2023
7c2f6b0
Clippy deny print statements. (#66) (#69)
obi1kenobi Feb 4, 2023
3581e6b
Add `renaming_reexport_of_reexport` test crate. (#70) (#75)
obi1kenobi Feb 5, 2023
29aee53
Extract a function for testing re-exports with matching names. (#71) …
obi1kenobi Feb 5, 2023
363cdd9
Fix error message text. (#79) (#82)
obi1kenobi Feb 5, 2023
a2c3fc9
Lint our rustdoc. (#83) (#84)
obi1kenobi Feb 14, 2023
84072e7
Don't fetch dependency info when reporting the current crate version.…
obi1kenobi Feb 22, 2023
3286cb1
Begin renaming items to match Trustfall v0.3 conventions. (#93)
obi1kenobi Mar 23, 2023
40cf897
Use the new helpers in Trustfall v0.3. (#95)
obi1kenobi Mar 23, 2023
d3da0d2
Add `explicit_reexport_of_matching_names` test case. (#72)
obi1kenobi Mar 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,31 @@ jobs:
profile: minimal
override: true

- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: Swatinem/rust-cache@v2

- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-features --all-targets -- -D warnings --allow deprecated
args: --workspace --all-features --all-targets -- -D warnings -Dclippy::print_stdout -Dclippy::print_stderr -Dclippy::dbg_macro --allow deprecated

- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

- name: cargo doc
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --workspace --all-features --no-deps --document-private-items

rust-tests:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: ["1.67"]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -72,18 +72,14 @@ jobs:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true

- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: Swatinem/rust-cache@v2

- name: Regenerate test data
run: ./scripts/regenerate_test_rustdocs.sh +${{ matrix.toolchain }}

- name: compile
run: cargo test --no-run
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Generated by Cargo
# will have compiled files and executables
/target/
**/target/

# Local configuration for the project.
.cargo/

# These are backup files generated by rustfmt
**/*.rs.bk

# local-only data
localdata/

# lockfiles of test crates
test_crates/**/Cargo.lock
106 changes: 29 additions & 77 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trustfall-rustdoc-adapter"
version = "23.0.0"
version = "23.2.1"
edition = "2021"
authors = ["Predrag Gruevski <obi1kenobi82@gmail.com>"]
license = "Apache-2.0 OR MIT"
Expand All @@ -11,9 +11,12 @@ readme = "./README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
trustfall_core = "0.1.1"
trustfall = "0.3.4"
rustdoc-types = "0.19.0"

[dev-dependencies]
anyhow = "1.0.58"
itertools = "0.10.5"
serde_json = "1.0.85"
serde = { version = "1.0.145", features = ["derive"] }
maplit = "1.0.2"
2 changes: 1 addition & 1 deletion scripts/get_current_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ cd "$(git rev-parse --show-toplevel)"
# The first argument should be the name of a crate.
CRATE_NAME="$1"

cargo metadata --format-version 1 | \
cargo metadata --no-deps --format-version 1 | \
jq --arg crate_name "$CRATE_NAME" --exit-status -r \
'.packages[] | select(.name == $crate_name) | .version'
34 changes: 34 additions & 0 deletions scripts/regenerate_test_rustdocs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

# Fail on first error, on undefined variables, and on failures in pipelines.
set -euo pipefail

export CARGO_TARGET_DIR=/tmp/test_crates
RUSTDOC_OUTPUT_DIR="$CARGO_TARGET_DIR/doc"
TOPLEVEL="$(git rev-parse --show-toplevel)"
TARGET_DIR="$TOPLEVEL/localdata/test_data"

# Allow setting an explicit toolchain, like +nightly or +beta.
set +u
TOOLCHAIN="$1"
set -u
echo "Generating rustdoc with: $(cargo $TOOLCHAIN --version)"
RUSTDOC_CMD="cargo $TOOLCHAIN rustdoc"

# Run rustdoc on test_crates/*/
for crate_path in $(find "$TOPLEVEL/test_crates/" -maxdepth 1 -mindepth 1 -type d); do
# Removing path prefix, leaving only the directory name without forward slashes
crate=${crate_path#"$TOPLEVEL/test_crates/"}

if [[ -f "$TOPLEVEL/test_crates/$crate/Cargo.toml" ]]; then
echo "Generating: $crate"

pushd "$TOPLEVEL/test_crates/$crate"
RUSTC_BOOTSTRAP=1 $RUSTDOC_CMD -- -Zunstable-options --document-private-items --document-hidden-items --output-format=json
mkdir -p "$TARGET_DIR/$crate"
mv "$RUSTDOC_OUTPUT_DIR/$crate.json" "$TARGET_DIR/$crate/rustdoc.json"
popd
fi
done

unset CARGO_TARGET_DIR
Loading