Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Run clang analyzer on iOS and macOS code in CI test when packages change #2186

Merged
merged 2 commits into from
Oct 14, 2019

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Oct 12, 2019

Description

Add the --analyzer flag during linting to run clang analyzer.
Skip packages with known analyzer warnings.
I tested this by faking out a change in every package locally and confirmed this script still passes.

Related Issues

Fixes flutter/flutter#41443.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the [CLA].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@jmagman jmagman requested a review from mklim October 12, 2019 01:35
Copy link
Contributor

@mklim mklim left a comment

Choose a reason for hiding this comment

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

LGTM

Skip packages with known analyzer warnings.

Some linters have a concept of a "baseline" instead, where you can save all existing errors and choose to ignore them but still fail if any new errors are introduced. I checked really quickly and that doesn't seem like it's possible with pod lib lint but I'm mentioning it because if it were I think it would be preferable to totally skipping the packages that fail already.

# 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.

@jmagman jmagman merged commit 8697a03 into flutter:master Oct 14, 2019
@jmagman jmagman deleted the analyzer branch October 14, 2019 21:38
@jmagman
Copy link
Member Author

jmagman commented Oct 14, 2019

LGTM

Skip packages with known analyzer warnings.

Some linters have a concept of a "baseline" instead, where you can save all existing errors and choose to ignore them but still fail if any new errors are introduced. I checked really quickly and that doesn't seem like it's possible with pod lib lint but I'm mentioning it because if it were I think it would be preferable to totally skipping the packages that fail already.

I figure analyzing most of the projects is better than analyzing none, though locking to a baseline would be nice!

mormih pushed a commit to mormih/plugins that referenced this pull request Nov 17, 2019
sungmin-park pushed a commit to sungmin-park/flutter-plugins that referenced this pull request Dec 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --analyze flag to pod lib lint pre-submit plugin tests
3 participants