-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5422 from twsouthwick/merge-multiple-public-apis
Thanks for all your hard work @twsouthwick!
- Loading branch information
Showing
9 changed files
with
335 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.IO; | ||
|
||
namespace Microsoft.CodeAnalysis.PublicApiAnalyzers | ||
{ | ||
public readonly struct PublicApiFile | ||
{ | ||
public PublicApiFile(string path) | ||
{ | ||
var fileName = Path.GetFileName(path); | ||
|
||
IsShipping = IsFile(fileName, DeclarePublicApiAnalyzer.ShippedFileNamePrefix); | ||
var isUnshippedFile = IsFile(fileName, DeclarePublicApiAnalyzer.UnshippedFileNamePrefix); | ||
|
||
IsApiFile = IsShipping || isUnshippedFile; | ||
} | ||
|
||
public bool IsShipping { get; } | ||
|
||
public bool IsApiFile { get; } | ||
|
||
private static bool IsFile(string path, string prefix) | ||
=> path.StartsWith(prefix, StringComparison.Ordinal) && path.EndsWith(DeclarePublicApiAnalyzer.Extension, StringComparison.Ordinal); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.