From 621799218a70ddfac4463980d495513eca69fcb5 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Thu, 8 Aug 2024 16:51:22 -0700 Subject: [PATCH] Fix "unintended_html_in_doc_comment" analysis errors --- pkgs/http/lib/http.dart | 30 +++++++++---------- pkgs/http/lib/src/base_response.dart | 11 +++---- pkgs/http/lib/src/client.dart | 28 ++++++++--------- .../src/compressed_response_body_server.dart | 2 +- .../lib/src/redirect_server.dart | 2 +- .../lib/src/request_headers_server.dart | 2 +- pkgs/http_profile/lib/src/utils.dart | 13 ++++---- 7 files changed, 45 insertions(+), 43 deletions(-) diff --git a/pkgs/http/lib/http.dart b/pkgs/http/lib/http.dart index da35b23a87..317a2c17f3 100644 --- a/pkgs/http/lib/http.dart +++ b/pkgs/http/lib/http.dart @@ -50,15 +50,15 @@ Future get(Uri url, {Map? 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] or -/// a [Map]. 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` or +/// a `Map`. 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. /// @@ -73,15 +73,15 @@ Future 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] or -/// a [Map]. 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` or +/// a `Map`. 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. /// @@ -97,15 +97,15 @@ Future 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] or -/// a [Map]. 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` or +/// a `Map`. 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. /// diff --git a/pkgs/http/lib/src/base_response.dart b/pkgs/http/lib/src/base_response.dart index 0527461dbb..5a076d1f2e 100644 --- a/pkgs/http/lib/src/base_response.dart +++ b/pkgs/http/lib/src/base_response.dart @@ -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: -/// - e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT" -/// - e.g. "Path=somepath," -/// - e.g. "AnyString,Really," +/// - `` e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT" +/// - `` e.g. "Path=somepath," +/// - `` e.g. "AnyString,Really," /// /// Some values are ambiguous e.g. /// "Set-Cookie: lang=en; Path=/foo/" @@ -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 ",=" is more likely to -/// start a new then be part of or . +/// The idea behind this regex is that `,=` is more likely to +/// start a new `` then be part of `` or +/// ``. /// /// See https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1 var _setCookieSplitter = RegExp(r'[ \t]*,[ \t]*(?=[' + _tokenChars + r']+=)'); diff --git a/pkgs/http/lib/src/client.dart b/pkgs/http/lib/src/client.dart index 6de5698104..8ee554a241 100644 --- a/pkgs/http/lib/src/client.dart +++ b/pkgs/http/lib/src/client.dart @@ -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] - /// or a [Map]. + /// [body] sets the body of the request. It can be a `String`, a `List` + /// or a `Map`. /// - /// 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. /// @@ -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] - /// or a [Map]. If it's a String, it's encoded using + /// [body] sets the body of the request. It can be a `String`, a `List` + /// or a `Map`. 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. /// @@ -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] - /// or a [Map]. If it's a String, it's encoded using + /// [body] sets the body of the request. It can be a `String`, a `List` + /// or a `Map`. 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. /// diff --git a/pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server.dart b/pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server.dart index 17f8897cc8..bb4b95d1e8 100644 --- a/pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server.dart +++ b/pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server.dart @@ -13,7 +13,7 @@ import 'package:stream_channel/stream_channel.dart'; /// On Startup: /// - send port /// On Request Received: -/// - send headers as Map> +/// - send headers as `Map>` /// When Receive Anything: /// - exit void hybridMain(StreamChannel channel) async { diff --git a/pkgs/http_client_conformance_tests/lib/src/redirect_server.dart b/pkgs/http_client_conformance_tests/lib/src/redirect_server.dart index cf1fafddb8..2813e32239 100644 --- a/pkgs/http_client_conformance_tests/lib/src/redirect_server.dart +++ b/pkgs/http_client_conformance_tests/lib/src/redirect_server.dart @@ -18,7 +18,7 @@ import 'package:stream_channel/stream_channel.dart'; /// ".../9" | ".../8" /// ... | ... /// ".../1" | "/" -/// "/" | <200 return> +/// "/" | <200 return> void hybridMain(StreamChannel channel) async { late HttpServer server; diff --git a/pkgs/http_client_conformance_tests/lib/src/request_headers_server.dart b/pkgs/http_client_conformance_tests/lib/src/request_headers_server.dart index c443ad0034..ad3fdfe0cc 100644 --- a/pkgs/http_client_conformance_tests/lib/src/request_headers_server.dart +++ b/pkgs/http_client_conformance_tests/lib/src/request_headers_server.dart @@ -13,7 +13,7 @@ import 'package:stream_channel/stream_channel.dart'; /// On Startup: /// - send port /// On Request Received: -/// - send headers as Map> +/// - send headers as `Map>` /// When Receive Anything: /// - exit void hybridMain(StreamChannel channel) async { diff --git a/pkgs/http_profile/lib/src/utils.dart b/pkgs/http_profile/lib/src/utils.dart index 0225f87f39..f8209bcab4 100644 --- a/pkgs/http_profile/lib/src/utils.dart +++ b/pkgs/http_profile/lib/src/utils.dart @@ -10,13 +10,13 @@ const _tokenChars = r"!#$%&'*+\-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`" /// Splits comma-separated header values. var _headerSplitter = RegExp(r'[ \t]*,[ \t]*'); -/// Splits comma-separated "Set-Cookie" header values. +/// Splits comma-seperated "Set-Cookie" header values. /// /// Set-Cookie strings can contain commas. In particular, the following /// productions defined in RFC-6265, section 4.1.1: -/// - e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT" -/// - e.g. "Path=somepath," -/// - e.g. "AnyString,Really," +/// - `` e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT" +/// - `` e.g. "Path=somepath," +/// - `` e.g. "AnyString,Really," /// /// Some values are ambiguous e.g. /// "Set-Cookie: lang=en; Path=/foo/" @@ -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 ",=" is more likely to -/// start a new then be part of or . +/// The idea behind this regex is that `,=` is more likely to +/// start a new `` then be part of `` or +/// ``. /// /// See https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1 var _setCookieSplitter = RegExp(r'[ \t]*,[ \t]*(?=[' + _tokenChars + r']+=)');