Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "unintended_html_in_doc_comment" analysis errors #1291

Merged
merged 5 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
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
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
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
Loading