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

Check lxd-agent imports #13219

Merged
merged 3 commits into from
Apr 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
8 changes: 6 additions & 2 deletions test/lint/client-imports.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/bin/sh -eu
#!/bin/sh
set -eu

echo "Checking for imports that have been added to client or shared..."

OUT=$(go list -f '{{ join .Imports "\n" }}' ./client ./shared/api ./lxc/config | grep -F . | sort -u | diff -u test/godeps.list - || true)
# Ensure predictable sorting
export LC_ALL=C.UTF-8

OUT=$(go list -f '{{ join .Imports "\n" }}' ./client ./shared/api ./lxc/config | grep -F . | sort -u | diff -u test/client-godeps.list - || true)
if [ -n "${OUT}" ]; then
echo "ERROR: you added a new dependency to the client or shared; please make sure this is what you want"
echo "${OUT}"
Expand Down
14 changes: 14 additions & 0 deletions test/lint/lxd-agent-imports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -eu

echo "Checking for imports that have been added to the lxd-agent..."

# Ensure predictable sorting
export LC_ALL=C.UTF-8

OUT=$(go list -f '{{ join .Deps "\n" }}' ./lxd-agent | grep -F . | sort -u | diff -u test/lxd-agent-godeps.list - || true)
if [ -n "${OUT}" ]; then
echo "ERROR: you added a new dependency to the lxd-agent; please make sure this is what you want"
echo "${OUT}"
exit 1
fi