Support the latest pkg:analyzer, prepare to release v2.2.4 (#1137)

diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml
index 20e0706..c9190e9 100644
--- a/.github/workflows/test-package.yml
+++ b/.github/workflows/test-package.yml
@@ -5,7 +5,7 @@
   push:
     branches: [ master ]
   pull_request:
-    branches: [ master, bump-2.0.2 ]
+    branches: [ master]
   schedule:
     - cron: "0 0 * * 0"
 
@@ -20,7 +20,7 @@
     strategy:
       fail-fast: false
       matrix:
-        sdk: [dev]
+        sdk: [2.17.0, dev]
     steps:
       - uses: actions/checkout@v2
       - uses: dart-lang/setup-dart@v1.0
@@ -31,10 +31,13 @@
         run: dart pub get
       - name: Check formatting
         run: dart format --output=none --set-exit-if-changed .
-        if: always() && steps.install.outcome == 'success'
+        if: always() && steps.install.outcome == 'success' && matrix.sdk == 'dev'
       - name: Analyze code
         run: dart analyze --fatal-infos
-        if: always() && steps.install.outcome == 'success'
+        if: always() && steps.install.outcome == 'success' && matrix.sdk == 'dev'
+      - name: Analyze code
+        run: dart analyze
+        if: always() && steps.install.outcome == 'success' && matrix.sdk != 'dev'
 
   # Run tests on a matrix consisting of two dimensions:
   # 1. OS: ubuntu-latest, (macos-latest, windows-latest)
@@ -47,7 +50,7 @@
       matrix:
         # Add macos-latest and/or windows-latest if relevant for this package.
         os: [ubuntu-latest]
-        sdk: [dev]
+        sdk: [2.17.0, dev]
     steps:
       - uses: actions/checkout@v2
       - uses: dart-lang/setup-dart@v1.0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6108fdb..3e75c35 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,29 +1,22 @@
-# 2.2.4-dev
+# 2.2.4
 
 * Unify how brace-delimited syntax is formatted. This is mostly an internal
   refactoring, but slightly changes how a type body containing only an inline
   block comment is formatted.
-
 * Refactor Chunk to store split before text instead of after. This mostly does
   not affect the visible behavior of the formatter, but a few edge cases are
   handled slightly differently. These are all bug fixes where the previous
   behavior was unintentional. The changes are:
-
-  * Consistently discard blank lines between a `{` or `[` and a subsequent
-    comment. It used to do this before the `{` in type bodies, but not switch
-    bodies, optional parameter sections, or named parameter sections.
-
-  * Don't allow splitting an empty class body.
-
-  * Allow splitting after an inline block comment in some places where it makes
-    sense.
-
-  * Don't allow a line comment in an argument list to cause preceding arguments
-    to be misformatted.
-
-  * Remove blank lines after a line comment at the end of a body.
-
-* Require `package:analyzer` version `4.4.0`.
+* Consistently discard blank lines between a `{` or `[` and a subsequent
+  comment. It used to do this before the `{` in type bodies, but not switch
+  bodies, optional parameter sections, or named parameter sections.
+* Don't allow splitting an empty class body.
+* Allow splitting after an inline block comment in some places where it makes
+  sense.
+* Don't allow a line comment in an argument list to cause preceding arguments
+  to be misformatted.
+* Remove blank lines after a line comment at the end of a body.
+* Require `package:analyzer` `>=4.4.0 <6.0.0`. 
 
 # 2.2.3
 
diff --git a/lib/src/cli/formatter_options.dart b/lib/src/cli/formatter_options.dart
index 2887029..c2f185b 100644
--- a/lib/src/cli/formatter_options.dart
+++ b/lib/src/cli/formatter_options.dart
@@ -11,7 +11,7 @@
 import 'summary.dart';
 
 // Note: The following line of code is modified by tool/grind.dart.
-const dartStyleVersion = '2.2.2';
+const dartStyleVersion = '2.2.4';
 
 /// Global options that affect how the formatter produces and uses its outputs.
 class FormatterOptions {
diff --git a/pubspec.lock b/pubspec.lock
index 90f3dd0..123d5a8 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -7,14 +7,14 @@
       name: _fe_analyzer_shared
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "44.0.0"
+    version: "48.0.0"
   analyzer:
     dependency: "direct main"
     description:
       name: analyzer
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "4.4.0"
+    version: "5.0.0"
   args:
     dependency: "direct main"
     description:
@@ -63,7 +63,7 @@
       name: coverage
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.5.0"
+    version: "1.6.0"
   crypto:
     dependency: transitive
     description:
@@ -84,7 +84,7 @@
       name: frontend_server_client
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.1.3"
+    version: "3.0.0"
   glob:
     dependency: transitive
     description:
@@ -280,21 +280,21 @@
       name: test
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.21.4"
+    version: "1.21.6"
   test_api:
     dependency: transitive
     description:
       name: test_api
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.4.12"
+    version: "0.4.14"
   test_core:
     dependency: transitive
     description:
       name: test_core
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.4.16"
+    version: "0.4.18"
   test_descriptor:
     dependency: "direct dev"
     description:
@@ -322,7 +322,7 @@
       name: vm_service
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "9.3.0"
+    version: "9.4.0"
   watcher:
     dependency: transitive
     description:
@@ -343,7 +343,7 @@
       name: webkit_inspection_protocol
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0"
+    version: "1.2.0"
   yaml:
     dependency: "direct dev"
     description:
@@ -352,4 +352,4 @@
     source: hosted
     version: "3.1.1"
 sdks:
-  dart: ">=2.17.0 <3.0.0"
+  dart: ">=2.18.0 <3.0.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index 6e2df34..bfd6f2c 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
 name: dart_style
 # Note: See tool/grind.dart for how to bump the version.
-version: 2.2.4-dev
+version: 2.2.4
 description: >-
   Opinionated, automatic Dart source code formatter.
   Provides an API and a CLI tool.
@@ -9,7 +9,7 @@
   sdk: ">=2.17.0 <3.0.0"
 
 dependencies:
-  analyzer: '>=4.4.0 <5.0.0'
+  analyzer: '>=4.4.0 <6.0.0'
   args: ">=1.0.0 <3.0.0"
   path: ^1.0.0
   pub_semver: ">=1.4.4 <3.0.0"