Skip to content

Commit

Permalink
Fix "unintended_html_in_doc_comment" analysis errors (#1291)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan authored Aug 13, 2024
1 parent 76512c4 commit 4322382
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 44 deletions.
4 changes: 4 additions & 0 deletions pkgs/http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.3-wip

* Fixed unintended HTML tags in doc comments.

## 1.2.2

* Require package `web: '>=0.5.0 <2.0.0'`.
Expand Down
30 changes: 15 additions & 15 deletions pkgs/http/lib/http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ Future<Response> get(Uri url, {Map<String, String>? headers}) =>

/// Sends an HTTP POST request with the given headers and body to the given URL.
///
/// [body] sets the body of the request. It can be a [String], a [List<int>] or
/// a [Map<String, String>]. If it's a String, it's encoded using [encoding] and
/// used as the body of the request. The content-type of the request will
/// [body] sets the body of the request. It can be a `String`, a `List<int>` or
/// a `Map<String, String>`. If it's a `String`, it's encoded using [encoding]
/// and used as the body of the request. The content-type of the request will
/// default to "text/plain".
///
/// If [body] is a List, it's used as a list of bytes for the body of the
/// If [body] is a `List`, it's used as a list of bytes for the body of the
/// request.
///
/// If [body] is a Map, it's encoded as form fields using [encoding]. The
/// If [body] is a `Map`, it's encoded as form fields using [encoding]. The
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
Expand All @@ -73,15 +73,15 @@ Future<Response> post(Uri url,

/// Sends an HTTP PUT request with the given headers and body to the given URL.
///
/// [body] sets the body of the request. It can be a [String], a [List<int>] or
/// a [Map<String, String>]. If it's a String, it's encoded using [encoding] and
/// used as the body of the request. The content-type of the request will
/// [body] sets the body of the request. It can be a `String`, a `List<int>` or
/// a `Map<String, String>`. If it's a `String`, it's encoded using [encoding]
/// and used as the body of the request. The content-type of the request will
/// default to "text/plain".
///
/// If [body] is a List, it's used as a list of bytes for the body of the
/// If [body] is a `List`, it's used as a list of bytes for the body of the
/// request.
///
/// If [body] is a Map, it's encoded as form fields using [encoding]. The
/// If [body] is a `Map`, it's encoded as form fields using [encoding]. The
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
Expand All @@ -97,15 +97,15 @@ Future<Response> put(Uri url,
/// Sends an HTTP PATCH request with the given headers and body to the given
/// URL.
///
/// [body] sets the body of the request. It can be a [String], a [List<int>] or
/// a [Map<String, String>]. If it's a String, it's encoded using [encoding] and
/// used as the body of the request. The content-type of the request will
/// [body] sets the body of the request. It can be a `String`, a `List<int>` or
/// a `Map<String, String>`. If it's a `String`, it's encoded using [encoding]
/// and used as the body of the request. The content-type of the request will
/// default to "text/plain".
///
/// If [body] is a List, it's used as a list of bytes for the body of the
/// If [body] is a `List`, it's used as a list of bytes for the body of the
/// request.
///
/// If [body] is a Map, it's encoded as form fields using [encoding]. The
/// If [body] is a `Map`, it's encoded as form fields using [encoding]. The
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
Expand Down
11 changes: 6 additions & 5 deletions pkgs/http/lib/src/base_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ var _headerSplitter = RegExp(r'[ \t]*,[ \t]*');
///
/// Set-Cookie strings can contain commas. In particular, the following
/// productions defined in RFC-6265, section 4.1.1:
/// - <sane-cookie-date> e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT"
/// - <path-value> e.g. "Path=somepath,"
/// - <extension-av> e.g. "AnyString,Really,"
/// - `<sane-cookie-date>` e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT"
/// - `<path-value>` e.g. "Path=somepath,"
/// - `<extension-av>` e.g. "AnyString,Really,"
///
/// Some values are ambiguous e.g.
/// "Set-Cookie: lang=en; Path=/foo/"
Expand All @@ -128,8 +128,9 @@ var _headerSplitter = RegExp(r'[ \t]*,[ \t]*');
/// "Set-Cookie: lang=en; Path=/foo/,SID=x23"
/// would both be result in `response.headers` => "lang=en; Path=/foo/,SID=x23"
///
/// The idea behind this regex is that ",<valid token>=" is more likely to
/// start a new <cookie-pair> then be part of <path-value> or <extension-av>.
/// The idea behind this regex is that `,<valid token>=` is more likely to
/// start a new `<cookie-pair>` than be part of `<path-value>` or
/// `<extension-av>`.
///
/// See https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1
var _setCookieSplitter = RegExp(r'[ \t]*,[ \t]*(?=[' + _tokenChars + r']+=)');
Expand Down
28 changes: 14 additions & 14 deletions pkgs/http/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ abstract interface class Client {
/// Sends an HTTP POST request with the given headers and body to the given
/// URL.
///
/// [body] sets the body of the request. It can be a [String], a [List<int>]
/// or a [Map<String, String>].
/// [body] sets the body of the request. It can be a `String`, a `List<int>`
/// or a `Map<String, String>`.
///
/// If [body] is a String, it's encoded using [encoding] and used as the body
/// of the request. The content-type of the request will default to
/// If [body] is a `String`, it's encoded using [encoding] and used as the
/// body of the request. The content-type of the request will default to
/// "text/plain".
///
/// If [body] is a List, it's used as a list of bytes for the body of the
/// If [body] is a `List`, it's used as a list of bytes for the body of the
/// request.
///
/// If [body] is a Map, it's encoded as form fields using [encoding]. The
/// If [body] is a `Map`, it's encoded as form fields using [encoding]. The
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
Expand All @@ -77,15 +77,15 @@ abstract interface class Client {
/// Sends an HTTP PUT request with the given headers and body to the given
/// URL.
///
/// [body] sets the body of the request. It can be a [String], a [List<int>]
/// or a [Map<String, String>]. If it's a String, it's encoded using
/// [body] sets the body of the request. It can be a `String`, a `List<int>`
/// or a `Map<String, String>`. If it's a `String`, it's encoded using
/// [encoding] and used as the body of the request. The content-type of the
/// request will default to "text/plain".
///
/// If [body] is a List, it's used as a list of bytes for the body of the
/// If [body] is a `List`, it's used as a list of bytes for the body of the
/// request.
///
/// If [body] is a Map, it's encoded as form fields using [encoding]. The
/// If [body] is a `Map`, it's encoded as form fields using [encoding]. The
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
Expand All @@ -98,15 +98,15 @@ abstract interface class Client {
/// Sends an HTTP PATCH request with the given headers and body to the given
/// URL.
///
/// [body] sets the body of the request. It can be a [String], a [List<int>]
/// or a [Map<String, String>]. If it's a String, it's encoded using
/// [body] sets the body of the request. It can be a `String`, a `List<int>`
/// or a `Map<String, String>`. If it's a `String`, it's encoded using
/// [encoding] and used as the body of the request. The content-type of the
/// request will default to "text/plain".
///
/// If [body] is a List, it's used as a list of bytes for the body of the
/// If [body] is a `List`, it's used as a list of bytes for the body of the
/// request.
///
/// If [body] is a Map, it's encoded as form fields using [encoding]. The
/// If [body] is a `Map`, it's encoded as form fields using [encoding]. The
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
Expand Down
2 changes: 1 addition & 1 deletion pkgs/http/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: http
version: 1.2.2
version: 1.2.3-wip
description: A composable, multi-platform, Future-based API for HTTP requests.
repository: https://github.com/dart-lang/http/tree/master/pkgs/http

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:stream_channel/stream_channel.dart';
/// On Startup:
/// - send port
/// On Request Received:
/// - send headers as Map<String, List<String>>
/// - send headers as `Map<String, List<String>>`
/// When Receive Anything:
/// - exit
void hybridMain(StreamChannel<Object?> channel) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import 'package:stream_channel/stream_channel.dart';
/// ".../9" | ".../8"
/// ... | ...
/// ".../1" | "/"
/// "/" | <200 return>
/// "/" | &lt;200 return&gt;
void hybridMain(StreamChannel<Object?> channel) async {
late HttpServer server;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:stream_channel/stream_channel.dart';
/// On Startup:
/// - send port
/// On Request Received:
/// - send headers as Map<String, List<String>>
/// - send headers as `Map<String, List<String>>`
/// When Receive Anything:
/// - exit
void hybridMain(StreamChannel<Object?> channel) async {
Expand Down
4 changes: 4 additions & 0 deletions pkgs/http_profile/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.1-wip

* Fixed unintended HTML tags in doc comments.

## 0.1.0

* Initial **experimental** release.
11 changes: 6 additions & 5 deletions pkgs/http_profile/lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ var _headerSplitter = RegExp(r'[ \t]*,[ \t]*');
///
/// Set-Cookie strings can contain commas. In particular, the following
/// productions defined in RFC-6265, section 4.1.1:
/// - <sane-cookie-date> e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT"
/// - <path-value> e.g. "Path=somepath,"
/// - <extension-av> e.g. "AnyString,Really,"
/// - `<sane-cookie-date>` e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT"
/// - `<path-value>` e.g. "Path=somepath,"
/// - `<extension-av>` e.g. "AnyString,Really,"
///
/// Some values are ambiguous e.g.
/// "Set-Cookie: lang=en; Path=/foo/"
Expand All @@ -25,8 +25,9 @@ var _headerSplitter = RegExp(r'[ \t]*,[ \t]*');
/// "Set-Cookie: lang=en; Path=/foo/,SID=x23"
/// would both be result in `response.headers` => "lang=en; Path=/foo/,SID=x23"
///
/// The idea behind this regex is that ",<valid token>=" is more likely to
/// start a new <cookie-pair> then be part of <path-value> or <extension-av>.
/// The idea behind this regex is that `,<valid token>=` is more likely to
/// start a new `<cookie-pair>` than be part of `<path-value>` or
/// `<extension-av>`.
///
/// See https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1
var _setCookieSplitter = RegExp(r'[ \t]*,[ \t]*(?=[' + _tokenChars + r']+=)');
Expand Down
2 changes: 1 addition & 1 deletion pkgs/http_profile/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
A library used by HTTP client authors to integrate with the DevTools Network
View.
repository: https://github.com/dart-lang/http/tree/master/pkgs/http_profile
version: 0.1.0
version: 0.1.1-wip

environment:
sdk: ^3.4.0
Expand Down

0 comments on commit 4322382

Please sign in to comment.