Skip to content

Commit

Permalink
Lint cb (#32)
Browse files Browse the repository at this point in the history
* lint yml

* removed clones

* final newline, 2 spaces

* Wrong left-padding spaces(want multiple of 4)

* Wrong left-padding spaces(want multiple of 4)

* tabs to spaces left-padding wants multiple of 2

* No final newline expected

* No final newline expected

* removed detected clone

* newline

* newline, tabs to spaces 4

* try this again...

* updated linter

* Client.Test.cs(9,1): Fix whitespace formatting.
  • Loading branch information
milliorn authored Oct 31, 2021
1 parent d59ba77 commit 09d3c4e
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 144 deletions.
86 changes: 43 additions & 43 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet
{
"name": "C# (.NET)",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "6.0",
"NODE_VERSION": "16",
}
},
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],
// [Optional] To reuse of your local HTTPS dev cert:
//
// 1. Export it locally using this command:
// * Windows PowerShell:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
// * macOS/Linux terminal:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
//
// 2. Uncomment these 'remoteEnv' lines:
// "remoteEnv": {
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
// },
//
// 3. Do one of the following depending on your scenario:
// * When using GitHub Codespaces and/or Remote - Containers:
// 1. Start the container
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
//
// * If only using Remote - Containers with a local container, uncomment this line instead:
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "dotnet restore",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
"name": "C# (.NET)",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "6.0",
"NODE_VERSION": "16",
}
},
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],
// [Optional] To reuse of your local HTTPS dev cert:
//
// 1. Export it locally using this command:
// * Windows PowerShell:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
// * macOS/Linux terminal:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
//
// 2. Uncomment these 'remoteEnv' lines:
// "remoteEnv": {
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
// },
//
// 3. Do one of the following depending on your scenario:
// * When using GitHub Codespaces and/or Remote - Containers:
// 1. Start the container
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
//
// * If only using Remote - Containers with a local container, uncomment this line instead:
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "dotnet restore",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
2 changes: 0 additions & 2 deletions .github/workflows/abandoned.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

name: Delete abandoned branches

on:
# Run daily at midnight
schedule:
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
include-prerelease: true
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"
include-prerelease: true
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
26 changes: 4 additions & 22 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,37 @@
---
#################################
#################################
## Super Linter GitHub Actions ##
#################################
#################################
name: Lint Code Base

#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#

#############################
# Start the job on all push #
#############################
on:
push:
branches-ignore: [dev, main]
# Remove the line above to run when pushing to main
pull_request:
branches: [dev, main]

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
## Checkout the code base ##
- name: Checkout Code
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_CSHARP: true
LOG_LEVEL: ERROR
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
dotnet-version: "6.0.x"
include-prerelease: true

- name: Build
Expand All @@ -36,4 +36,4 @@ jobs:
run: dotnet pack API/NWN.MasterList.csproj --configuration Release -p:PackageVersion=${{ steps.name_version.outputs.version }} -o output

- name: Publish Package
run: dotnet nuget push output/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
run: dotnet nuget push output/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
12 changes: 6 additions & 6 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Close stale issues and PRs'
name: "Close stale issues and PRs"
on:
schedule:
- cron: '30 1 * * *'
- cron: "30 1 * * *"

jobs:
stale:
Expand All @@ -13,7 +13,7 @@ jobs:
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
stale-issue-message: "Stale issue message"
stale-pr-message: "Stale pull request message"
stale-issue-label: "no-issue-activity"
stale-pr-label: "no-pr-activity"
4 changes: 2 additions & 2 deletions API/NWN.MasterList.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
</Project>
</Project>
34 changes: 17 additions & 17 deletions Test/NWN.MasterList.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\API\NWN.MasterList.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\API\NWN.MasterList.csproj" />
</ItemGroup>
</Project>
38 changes: 1 addition & 37 deletions Test/src/Client.Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ public async void TestGetAllBuild() {
Assert.NotNull(collection);
}

[Fact]
public async void TestGetAllBuildByType() {
var collection = (await new MasterList.Client().GetServers()).GetAllFirstSeen();

foreach (var item in collection) {
output.WriteLine($"{item.ModuleName} -> {item.Build}");
}

Assert.NotEmpty(collection);
Assert.NotNull(collection);
}

[Fact]
public async void TestGetAllConnectionHint() {
var collection = (await new MasterList.Client().GetServers()).GetAllFirstSeen();
Expand Down Expand Up @@ -106,30 +94,6 @@ public async void TestGetAllElC() {
Assert.NotNull(collection);
}

[Fact]
public async void TestGetAllElcByType() {
var collection = (await new MasterList.Client().GetServers()).GetAllFirstSeen();

foreach (var item in collection) {
output.WriteLine($"{item.ModuleName} -> {item.ELC}");
}

Assert.NotEmpty(collection);
Assert.NotNull(collection);
}

[Fact]
public async void TestGetAllGameType() {
var collection = (await new MasterList.Client().GetServers()).GetAllFirstSeen();

foreach (var item in collection) {
output.WriteLine($"{item.ModuleName} -> {item.GameType}");
}

Assert.NotEmpty(collection);
Assert.NotNull(collection);
}

[Fact]
public async void TestGetAllGameTypeByType() {
var collection = (await new MasterList.Client().GetServers()).GetAllGameTypeByType(10);
Expand Down Expand Up @@ -532,4 +496,4 @@ public async void TestGetUniqueVersionCount() {
Assert.NotNull(collection);
}
}
}
}

0 comments on commit 09d3c4e

Please sign in to comment.