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

enable clippy when dependencies are used #73

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/target
target
**/*.rs.bk
*.swp
.git/
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@ updates:
interval: 'daily'
labels:
- 'x:size/small'
- package-ecosystem: 'cargo'
directory: '/local-registry'
schedule:
interval: 'weekly'
groups:
all:
patterns:
- "*"
labels:
- 'x:rep/tiny'
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ COPY . .

RUN cargo build --release

# cargo-local-registry stuff is copied from the test runner
FROM rust:1.80 AS build-cargo-local-registry

# install cargo-local-registry
RUN cargo install cargo-local-registry
# download popular crates to local registry
WORKDIR /local-registry
COPY local-registry/* ./
RUN cargo generate-lockfile && cargo local-registry --sync Cargo.lock .

FROM rust:1.80-slim

WORKDIR /opt/analyzer
Expand All @@ -14,5 +24,13 @@ RUN rustup component add clippy

COPY ./bin/run.sh ./bin/
COPY --from=base /analyzer/target/release/rust-analyzer ./bin/rust-analyzer
COPY --from=build-cargo-local-registry /local-registry local-registry/
# configure local-registry
RUN echo '[source.crates-io]\n\
registry = "https://github.com/rust-lang/crates.io-index"\n\
replace-with = "local-registry"\n\
\n\
[source.local-registry]\n\
local-registry = "/opt/analyzer/local-registry/"\n' >> $CARGO_HOME/config.toml

ENTRYPOINT ["bin/run.sh"]
1 change: 0 additions & 1 deletion bin/run-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ docker build --rm -t exercism/rust-analyzer .
docker run \
--rm \
--network none \
--read-only \
--mount type=bind,src="${solution_dir}",dst=/solution \
--mount type=bind,src="${output_dir}",dst=/output \
--mount type=tmpfs,dst=/tmp \
Expand Down
1 change: 0 additions & 1 deletion bin/run-tests-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ docker build --rm -t exercism/rust-analyzer .
docker run \
--rm \
--network none \
--read-only \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove this for the tests to pass. The flag is not present in the test-runner repo. Is it actually the case that analyzers have this additional flag? Or can it safely be removed from this test file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't yet enforce readonly, but might in the future. So it's fine for now

--mount type=bind,src="${PWD}/snippets",dst=/opt/analyzer/snippets \
--mount type=tmpfs,dst=/tmp \
--volume "${PWD}/bin/run-tests.sh:/opt/analyzer/bin/run-tests.sh" \
Expand Down
Loading