Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
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
43 changes: 32 additions & 11 deletions script/lint_darwin_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,52 @@ function lint_package() {
local package_dir="${REPO_DIR}/packages/$package_name/"
local failure_count=0

# These podspecs are temporary multi-platform adoption dummy files.
local skipped_podspecs=(
'url_launcher_web.podspec'
"url_launcher_web.podspec"
)
find "${package_dir}" -type f -name '*\.podspec' | while read podspec; do
# These podspecs are temporary multi-platform adoption dummy files.
if [[ "${skipped_podspecs[*]}" =~ "$(basename ${podspec})" ]]; then

# TODO: These packages have analyzer warnings. Remove plugins from this list as issues are fixed.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Is there a bug tracking this?

Copy link
Member Author

@jmagman jmagman Oct 14, 2019

Choose a reason for hiding this comment

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

I created issues and updated the comment.

local skip_analysis_packages=(
"camera.podspec" # https://github.com/flutter/flutter/issues/42673
"image_picker.podspec" # https://github.com/flutter/flutter/issues/42678
"in_app_purchase.podspec" # https://github.com/flutter/flutter/issues/42679
)
find "${package_dir}" -type f -name "*\.podspec" | while read podspec; do
local podspecBasename=$(basename "${podspec}")
if [[ "${skipped_podspecs[*]}" =~ "${podspecBasename}" ]]; then
continue
fi

echo "Linting $(basename ${podspec})"
# TODO: Remove --allow-warnings flag https://github.com/flutter/flutter/issues/41444
local lint_args=(
lib
lint
"${podspec}"
--allow-warnings
--fail-fast
--silent
)
if [[ ! "${skip_analysis_packages[*]}" =~ "${podspecBasename}" ]]; then
lint_args+=(--analyze)
echo "Linting and analyzing ${podspecBasename}"
else
echo "Linting ${podspecBasename}"
fi

# Build as frameworks.
# This will also run any tests set up as a test_spec. See https://blog.cocoapods.org/CocoaPods-1.3.0.
# TODO: Add --analyze flag https://github.com/flutter/flutter/issues/41443
# TODO: Remove --allow-warnings flag https://github.com/flutter/flutter/issues/41444
pod lib lint "${podspec}" --allow-warnings --fail-fast --silent
pod "${lint_args[@]}"
if [[ "$?" -ne 0 ]]; then
error "Package ${package_name} has framework issues. Run \"pod lib lint $podspec\" to inspect."
error "Package ${package_name} has framework issues. Run \"pod lib lint ${podspec} --analyze\" to inspect."
failure_count+=1
fi

# Build as libraries.
pod lib lint "${podspec}" --allow-warnings --use-libraries --fail-fast --silent
lint_args+=(--use-libraries)
pod "${lint_args[@]}"
if [[ "$?" -ne 0 ]]; then
error "Package ${package_name} has library issues. Run \"pod lib lint $podspec --use-libraries\" to inspect."
error "Package ${package_name} has library issues. Run \"pod lib lint ${podspec} --use-libraries --analyze\" to inspect."
failure_count+=1
fi
done
Expand Down