Skip to content

Commit

Permalink
Type export fix (#126)
Browse files Browse the repository at this point in the history
## What Changed?

Ensures that all marked types are exported. but no longer export types
of functions since their markers are handled separately.

Also moves `marker_db` to `ann::db` for better grouping. 
Fixes a small issue where `make fix-all` would run `clippy` on the
tests.
Bumps the `itertools` package to `0.12`.
Adds two convenient type aliases to the SPDG module.
Replaces the `actions-rs/cargo` action in workflows with a simple `cargo
install` because the action is deprecated.

## Why Does It Need To?

Some policies reason over all marked types and those types may not
appear in the PDG so not exporting them is unsound. (e.g. Plume
example).

Also running clippy on tests is a bad idea, because we may want to test
non-idiomatic code.

## Checklist

- [x] Above description has been filled out so that upon quash merge we
have a
  good record of what changed.
- [X] New functions, methods, types are documented. Old documentation is
updated
  if necessary
- [ ] Documentation in Notion has been updated
- [ ] Tests for new behaviors are provided
  - [ ] New test suites (if any) ave been added to the CI tests (in
`.github/workflows/rust.yml`) either as compiler test or integration
test.
*Or* justification for their omission from CI has been provided in this
PR
    description.
  • Loading branch information
JustusAdam authored Feb 22, 2024
1 parent ff2601d commit 20beff7
Show file tree
Hide file tree
Showing 15 changed files with 148 additions and 1,507 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ jobs:
git config --local user.email "docmaster+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
run: cargo install --force --debug cargo-make
- name: Prepare
run: |
cargo doc --document-private-items
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ jobs:
target/
key: ${{ runner.os }}-rust-deps-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
run: cargo install --force --debug cargo-make
- name: Build
run: cargo make install
- name: Run tests
Expand All @@ -57,10 +54,7 @@ jobs:
path: ~/.rustup
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain.toml') }}
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
run: cargo install --force --debug cargo-make
- name: Run checks
run: cargo make format-check-all

Expand All @@ -85,10 +79,7 @@ jobs:
target/
key: ${{ runner.os }}-rust-deps-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
run: cargo install --force --debug cargo-make
- name: Here come the complaints
run: cargo make clippy-check-all

Expand All @@ -113,9 +104,6 @@ jobs:
target/
key: ${{ runner.os }}-rust-deps-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
run: cargo install --force --debug cargo-make
- name: Here come the complaints
run: cargo make doc-check
4 changes: 2 additions & 2 deletions Cargo.lock

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

10 changes: 8 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,19 @@ Because we invoke the fix command multiple separate time it may fail again
because of unstaged changes after applying the first fix. Inspect the changes,
stage them and rerun the script until no more errors occur.
"""
env = { "FORMAT_ARGS" = "clippy --fix --allow-staged --all -- -Dwarnings" }
run_task = "format-run"

[tasks.clippy-all.env]
FORMAT_ARGS = "clippy --fix --allow-staged --all -- -Dwarnings"
INCLUDE_TESTS = { unset = true }

[tasks.clippy-check-all]
env = { "FORMAT_ARGS" = "clippy --all -- -Dwarnings" }
run_task = "format-run"

[tasks.clippy-check-all.env]
FORMAT_ARGS = "clippy --all -- -Dwarnings"
INCLUDE_TESTS = { unset = true }

[tasks.format-base]
description = """\
This is bit ugly, because we want to reuse this tasks
Expand Down
Loading

0 comments on commit 20beff7

Please sign in to comment.