Skip to content

Commit 477ecd0

Browse files
committed
Enabled all possible rules; Added linting to snippets;
1 parent 1b9558a commit 477ecd0

File tree

11 files changed

+35
-15
lines changed

11 files changed

+35
-15
lines changed

FirebaseAdmin/FirebaseAdmin.IntegrationTests/FirebaseAdmin.IntegrationTests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<TargetFramework>netcoreapp2.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
87
<CodeAnalysisRuleSet>../../stylecop_test.ruleset</CodeAnalysisRuleSet>
98
</PropertyGroup>
109

FirebaseAdmin/FirebaseAdmin.Snippets/FirebaseAdmin.Snippets.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.0</TargetFramework>
55
<IsPackable>false</IsPackable>
6+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7+
<CodeAnalysisRuleSet>../../stylecop_test.ruleset</CodeAnalysisRuleSet>
68
</PropertyGroup>
79

810
<ItemGroup>
@@ -11,6 +13,9 @@
1113

1214
<ItemGroup>
1315
<ProjectReference Include="..\FirebaseAdmin\FirebaseAdmin.csproj" />
16+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.1-beta.61">
17+
<PrivateAssets>all</PrivateAssets>
18+
</PackageReference>
1419
</ItemGroup>
1520

1621
</Project>

FirebaseAdmin/FirebaseAdmin.Snippets/FirebaseAppSnippets.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
namespace FirebaseAdmin.Snippets
2323
{
24-
class FirebaseAppSnippets
24+
internal class FirebaseAppSnippets
2525
{
26-
static void InitSdkWithServiceAccount()
26+
internal static void InitSdkWithServiceAccount()
2727
{
2828
// [START initialize_sdk_with_service_account]
2929
FirebaseApp.Create(new AppOptions()
@@ -33,7 +33,7 @@ static void InitSdkWithServiceAccount()
3333
// [END initialize_sdk_with_service_account]
3434
}
3535

36-
static void InitSdkWithApplicationDefault()
36+
internal static void InitSdkWithApplicationDefault()
3737
{
3838
// [START initialize_sdk_with_application_default]
3939
FirebaseApp.Create(new AppOptions()
@@ -43,7 +43,7 @@ static void InitSdkWithApplicationDefault()
4343
// [END initialize_sdk_with_application_default]
4444
}
4545

46-
static void InitSdkWithRefreshToken()
46+
internal static void InitSdkWithRefreshToken()
4747
{
4848
// [START initialize_sdk_with_refresh_token]
4949
FirebaseApp.Create(new AppOptions()
@@ -53,14 +53,14 @@ static void InitSdkWithRefreshToken()
5353
// [END initialize_sdk_with_refresh_token]
5454
}
5555

56-
static void InitSdkWithDefaultConfig()
56+
internal static void InitSdkWithDefaultConfig()
5757
{
5858
// [START initialize_sdk_with_default_config]
5959
FirebaseApp.Create();
6060
// [END initialize_sdk_with_default_config]
6161
}
6262

63-
static void InitDefaultApp()
63+
internal static void InitDefaultApp()
6464
{
6565
// [START access_services_default]
6666
// Initialize the default app
@@ -78,7 +78,7 @@ static void InitDefaultApp()
7878
// [END access_services_default]
7979
}
8080

81-
static void InitCustomApp()
81+
internal static void InitCustomApp()
8282
{
8383
var defaultOptions = new AppOptions()
8484
{
@@ -107,7 +107,7 @@ static void InitCustomApp()
107107
// [END access_services_nondefault]
108108
}
109109

110-
static void InitWithServiceAccountId()
110+
internal static void InitWithServiceAccountId()
111111
{
112112
// [START initialize_sdk_with_service_account_id]
113113
FirebaseApp.Create(new AppOptions()

FirebaseAdmin/FirebaseAdmin.Snippets/FirebaseAuthSnippets.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
namespace FirebaseAdmin.Snippets
2121
{
22-
class FirebaseAuthSnippets
22+
internal class FirebaseAuthSnippets
2323
{
24-
static async Task CreateCustomTokenAsync()
24+
internal static async Task CreateCustomTokenAsync()
2525
{
2626
// [START custom_token]
2727
var uid = "some-uid";
@@ -32,7 +32,7 @@ static async Task CreateCustomTokenAsync()
3232
Console.WriteLine("Created custom token: {0}", customToken);
3333
}
3434

35-
static async Task CreateCustomTokenWithClaimsAsync()
35+
internal static async Task CreateCustomTokenWithClaimsAsync()
3636
{
3737
// [START custom_token_with_claims]
3838
var uid = "some-uid";
@@ -48,7 +48,7 @@ static async Task CreateCustomTokenWithClaimsAsync()
4848
Console.WriteLine("Created custom token: {0}", customToken);
4949
}
5050

51-
static async Task VeridyIdTokenAsync(string idToken)
51+
internal static async Task VeridyIdTokenAsync(string idToken)
5252
{
5353
// [START verify_id_token]
5454
FirebaseToken decodedToken = await FirebaseAuth.DefaultInstance

FirebaseAdmin/FirebaseAdmin.Tests/FirebaseAdmin.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<AssemblyOriginatorKeyFile>../../FirebaseAdmin.snk</AssemblyOriginatorKeyFile>
77
<SignAssembly>true</SignAssembly>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
109
<CodeAnalysisRuleSet>../../stylecop_test.ruleset</CodeAnalysisRuleSet>
1110
</PropertyGroup>
1211

FirebaseAdmin/FirebaseAdmin/Auth/FirebaseAuth.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ public async Task<FirebaseToken> VerifyIdTokenAsync(
277277
.ConfigureAwait(false);
278278
}
279279

280+
/// <summary>
281+
/// Deletes this <see cref="FirebaseAuth"/> service instance.
282+
/// </summary>
280283
void IFirebaseService.Delete()
281284
{
282285
lock (this.authLock)

FirebaseAdmin/FirebaseAdmin/FirebaseAdmin.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<PackageReference Include="StyleCop.Analyzers" Version="1.1.1-beta.61">
3131
<PrivateAssets>all</PrivateAssets>
3232
</PackageReference>
33+
<AdditionalFiles Include="../../stylecop.json" />
3334
</ItemGroup>
3435

3536
</Project>

FirebaseAdmin/FirebaseAdmin/IFirebaseService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ namespace FirebaseAdmin
2020
/// </summary>
2121
internal interface IFirebaseService
2222
{
23+
/// <summary>
24+
/// Cleans up any state associated with this service making it unsuitable for further use.
25+
/// </summary>
2326
void Delete();
2427
}
2528
}

stylecop.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
3+
"settings": {
4+
"documentationRules": {
5+
"documentInternalElements": false
6+
}
7+
}
8+
}

stylecop.ruleset

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
77
<Rule Id="SA1200" Action="None" /> <!-- Using clauses inside namespaces -->
88
<Rule Id="SA1502" Action="None" /> <!-- Single-lined elements -->
9-
<Rule Id="SA1600" Action="None" /> <!-- Element should be documented -->
109
<Rule Id="SA1633" Action="None" /> <!-- Allow custom file header -->
1110
</Rules>
1211
</RuleSet>

0 commit comments

Comments
 (0)