Skip to content

Fix nearly all CS1591 #40106

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

Merged
merged 7 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 1 addition & 2 deletions src/Razor/Razor/src/Microsoft.AspNetCore.Razor.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Summary>Razor is a markup syntax for adding server-side logic to web pages. This package contains runtime components for rendering Razor pages and implementing tag helpers.</Summary>
Expand All @@ -12,7 +12,6 @@ Microsoft.AspNetCore.Razor.TagHelpers.ITagHelper</Description>
<IsAspNetCoreApp>true</IsAspNetCoreApp>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>$(PackageTags);taghelper;taghelpers</PackageTags>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<IsPackable>false</IsPackable>

<!-- Required to implement an HtmlEncoder -->
Expand Down
20 changes: 19 additions & 1 deletion src/Razor/Razor/src/TagHelpers/HtmlAttributeValueStyle.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Razor.TagHelpers;

/// <summary>
/// Determines how an HTML attribute value appears in markup.
/// </summary>
public enum HtmlAttributeValueStyle
{
/// <summary>
/// An attribute value that appears in double quotes.
/// </summary>
DoubleQuotes,

/// <summary>
/// An attribute value that appears in single quotes.
/// </summary>
SingleQuotes,

/// <summary>
/// An attribute value that appears without quotes.
/// </summary>
NoQuotes,

/// <summary>
/// A minimized attribute value.
/// </summary>
Minimized,
}
3 changes: 3 additions & 0 deletions src/Razor/Razor/src/TagHelpers/HtmlTargetElementAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers;
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public sealed class HtmlTargetElementAttribute : Attribute
{
/// <summary>
/// The value for a tag helper that targets all HTML elements.
/// </summary>
public const string ElementCatchAllTarget = "*";

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/Razor/Razor/src/TagHelpers/NullHtmlEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public override void Encode(TextWriter output, char[] value, int startIndex, int
output.Write(value, startIndex, characterCount);
}

/// <inheritdoc />
public override void Encode(TextWriter output, string value, int startIndex, int characterCount)
{
if (output == null)
Expand Down
1 change: 1 addition & 0 deletions src/Razor/Razor/src/TagHelpers/TagHelperOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ void IHtmlContentContainer.MoveTo(IHtmlContentBuilder destination)
Attributes.Clear();
}

/// <inheritdoc />
public void WriteTo(TextWriter writer, HtmlEncoder encoder)
{
if (writer == null)
Expand Down
11 changes: 11 additions & 0 deletions src/Servers/Connections.Abstractions/src/FileHandleType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ namespace Microsoft.AspNetCore.Connections;
/// </summary>
public enum FileHandleType
{
/// <summary>
/// Not a manual.
/// </summary>
Auto,

/// <summary>
/// Better than UDP.
/// </summary>
Tcp,

/// <summary>
/// Carries water when not burst.
/// </summary>
Pipe
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<IsAspNetCoreApp>true</IsAspNetCoreApp>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore</PackageTags>
<NoWarn>CS1591;$(NoWarn)</NoWarn>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
7 changes: 7 additions & 0 deletions src/Servers/Connections.Abstractions/src/TransferFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ namespace Microsoft.AspNetCore.Connections;
[Flags]
public enum TransferFormat
{
/// <summary>
/// A binary transport format.
/// </summary>
Binary = 0x01,

/// <summary>
/// A text output format.
/// </summary>
Text = 0x02
}
1 change: 1 addition & 0 deletions src/Servers/Connections.Abstractions/src/UriEndPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ public UriEndPoint(Uri uri)
/// </summary>
public Uri Uri { get; }

/// <inheritdoc/>
public override string ToString() => Uri.ToString();
}
3 changes: 3 additions & 0 deletions src/Servers/Kestrel/Core/src/BadHttpRequestException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ internal BadHttpRequestException(string message, int statusCode, RequestRejectio
}
}

/// <summary>
/// Gets the HTTP status code for this exception.
/// </summary>
public new int StatusCode { get => base.StatusCode; }

internal StringValues AllowedHeader { get; }
Expand Down
23 changes: 23 additions & 0 deletions src/Servers/Kestrel/Core/src/HttpProtocols.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,33 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core;
[Flags]
public enum HttpProtocols
{
/// <summary>
/// A missing HTTP protocol version.
/// </summary>
None = 0x0,

/// <summary>
/// The HTTP/1.0 protocol version.
/// </summary>
Http1 = 0x1,

/// <summary>
/// The HTTP/2.0 protocol version.
/// </summary>
Http2 = 0x2,

/// <summary>
/// The <see cref="Http1"/> and <see cref="Http2"/> protocol versions.
/// </summary>
Http1AndHttp2 = Http1 | Http2,

/// <summary>
/// The HTTP/3.0 protocol version.
/// </summary>
Http3 = 0x4,

/// <summary>
/// The <see cref="Http1"/>, <see cref="Http2"/> and <see cref="Http3"/> protocol versions.
/// </summary>
Http1AndHttp2AndHttp3 = Http1 | Http2 | Http3
}
56 changes: 56 additions & 0 deletions src/Servers/Kestrel/Core/src/Internal/Http/HttpMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,75 @@

namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
public enum HttpMethod : byte
{
/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Get,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Put,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Delete,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Post,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Head,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Trace,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Patch,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Connect,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Options,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Custom,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
None = byte.MaxValue,
}
22 changes: 22 additions & 0 deletions src/Servers/Kestrel/Core/src/Internal/Http/HttpParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,28 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;

using BadHttpRequestException = Microsoft.AspNetCore.Http.BadHttpRequestException;

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
/// <typeparam name="TRequestHandler">This API supports framework infrastructure and is not intended to be used
/// directly from application code.</typeparam>
public class HttpParser<TRequestHandler> : IHttpParser<TRequestHandler> where TRequestHandler : IHttpHeadersHandler, IHttpRequestLineHandler
{
private readonly bool _showErrorDetails;

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
public HttpParser() : this(showErrorDetails: true)
{
}

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
public HttpParser(bool showErrorDetails)
{
_showErrorDetails = showErrorDetails;
Expand All @@ -34,6 +48,10 @@ public HttpParser(bool showErrorDetails)
private const byte BytePercentage = (byte)'%';
private const int MinTlsRequestSize = 1; // We need at least 1 byte to check for a proper TLS request line

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
public bool ParseRequestLine(TRequestHandler handler, ref SequenceReader<byte> reader)
{
if (reader.TryReadTo(out ReadOnlySpan<byte> requestLine, ByteLF, advancePastDelimiter: true))
Expand Down Expand Up @@ -137,6 +155,10 @@ private void ParseRequestLine(TRequestHandler handler, ReadOnlySpan<byte> reques
handler.OnStartLine(versionAndMethod, path, startLine);
}

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
public bool ParseHeaders(TRequestHandler handler, ref SequenceReader<byte> reader)
{
while (!reader.End)
Expand Down
20 changes: 19 additions & 1 deletion src/Servers/Kestrel/Core/src/Internal/Http/HttpScheme.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
public enum HttpScheme
{
/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Unknown = -1,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Http = 0,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Https = 1
}
28 changes: 28 additions & 0 deletions src/Servers/Kestrel/Core/src/Internal/Http/HttpVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,39 @@

namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
public enum HttpVersion : sbyte
{
/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Unknown = -1,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Http10 = 0,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Http11 = 1,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Http2 = 2,

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
Http3 = 3
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
public interface IHttpHeadersHandler
{
/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
void OnStaticIndexedHeader(int index);

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
void OnStaticIndexedHeader(int index, ReadOnlySpan<byte> value);

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
void OnHeader(ReadOnlySpan<byte> name, ReadOnlySpan<byte> value);

/// <summary>
/// This API supports framework infrastructure and is not intended to be used
/// directly from application code.
/// </summary>
void OnHeadersComplete(bool endStream);
}
Loading