Skip to content

Commit

Permalink
Enforce dotnet format
Browse files Browse the repository at this point in the history
  • Loading branch information
Olaren15 committed May 26, 2024
1 parent e94f5b3 commit 3e07059
Show file tree
Hide file tree
Showing 24 changed files with 65 additions and 31 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,6 @@ end_of_line = crlf
[*.md]
# Double trailing spaces can be used for BR tags, and other instances are enforced by Markdownlint
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dalamud plugin build
name: Build and Test

on:
push:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check format

on:
push:
paths:
- "*.cs"
- ".editorconfig"

jobs:
check-format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x.x
- name: Run dotnet format
run: dotnet format --verify-no-changes
10 changes: 0 additions & 10 deletions Dalamud.Libs.targets

This file was deleted.

17 changes: 17 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>
<ItemGroup>
<PackageReference
Include="SonarAnalyzer.CSharp"
Version="9.25.1.91650"
PrivateAssets="all"
Condition="$(MSBuildProjectExtension) == '.csproj'"
/>
</ItemGroup>

<PropertyGroup>
<DalamudLibPath Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
<DalamudLibPath Condition="$([MSBuild]::IsOSPlatform('Linux'))">$(HOME)/.xlcore/dalamud/Hooks/dev/</DalamudLibPath>
<DalamudLibPath Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(HOME)/Library/Application Support/XIV on Mac/dalamud/Hooks/dev/</DalamudLibPath>
<DalamudLibPath Condition="$(DALAMUD_HOME) != ''">$(DALAMUD_HOME)/</DalamudLibPath>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace EasyTranslate.DalamudPlugin.Attributes;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Dalamud.Libs.targets"/>
<Import Project="$(DalamudLibPath)/targets/Dalamud.Plugin.targets"/>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using Dalamud.Plugin;
using EasyTranslate.DalamudPlugin.Resources;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Dalamud.Game.Gui.ContextMenu;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
Expand Down
3 changes: 2 additions & 1 deletion EasyTranslate.DalamudPlugin/Search/SearchView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ LanguageSwitcher languageSwitcher

SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new Vector2(300, 200), MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
MinimumSize = new Vector2(300, 200),
MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
};
}

Expand Down
3 changes: 2 additions & 1 deletion EasyTranslate.DalamudPlugin/Settings/SettingsView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ LanguageSwitcher languageSwitcher

SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new Vector2(300, 200), MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
MinimumSize = new Vector2(300, 200),
MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
};
}

Expand Down
6 changes: 6 additions & 0 deletions EasyTranslate.DalamudPlugin/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
}
},
"SonarAnalyzer.CSharp": {
"type": "Direct",
"requested": "[9.25.1.91650, )",
"resolved": "9.25.1.91650",
"contentHash": "Z1/H8vGk2FZ8m6TK++A1Tn5npEw0L0ZNVAgf0aPI/nkq4mTER+enRZcgrkhdSo1mGbFDFgEh5ym/j3Onk6mROA=="
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion EasyTranslate.Domain/Entities/ContentType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace EasyTranslate.Domain.Entities;
namespace EasyTranslate.Domain.Entities;

public enum ContentType
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Dalamud.Libs.targets"/>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Dalamud.Libs.targets"/>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using EasyTranslate.Domain.Entities;
using EasyTranslate.Domain.Entities;
using EasyTranslate.Infrastructure.GameData.Sheets;

namespace EasyTranslate.Infrastructure.GameData.Adapters;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using EasyTranslate.Domain.Entities;
using EasyTranslate.Domain.Entities;
using EasyTranslate.Infrastructure.GameData.Sheets;

namespace EasyTranslate.Infrastructure.GameData.Adapters;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using EasyTranslate.Domain.Entities;
using EasyTranslate.Domain.Entities;
using EasyTranslate.Infrastructure.GameData.Sheets;

namespace EasyTranslate.Infrastructure.GameData.Adapters;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using EasyTranslate.Domain.Entities;
using EasyTranslate.Domain.Entities;
using EasyTranslate.Infrastructure.GameData.Sheets;

namespace EasyTranslate.Infrastructure.GameData.Adapters;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using EasyTranslate.Domain.Entities;
using EasyTranslate.Domain.Entities;
using EasyTranslate.Domain.Repositories;

namespace EasyTranslate.Infrastructure.GameData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using EasyTranslate.Domain.Entities;
using EasyTranslate.Domain.Entities;
using Lumina.Excel;

namespace EasyTranslate.Infrastructure.GameData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.ComponentModel;
using Lumina.Data;
using EasyTranslate.Domain.Entities;

namespace EasyTranslate.Infrastructure.GameData;

using Lumina_Language = Language;
using Language = Domain.Entities.Language;
using Language = Language;
using Lumina_Language = Lumina.Data.Language;

internal static class LuminaLanguageExtension
{
Expand Down
2 changes: 1 addition & 1 deletion EasyTranslate.Infrastructure/GameData/SearchByNameQuery.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using EasyTranslate.Domain.Entities;
using EasyTranslate.Domain.Entities;
using ExcelModule = Lumina.Excel.ExcelModule;
using ExcelRow = Lumina.Excel.ExcelRow;
using Lumina_Language = Lumina.Data.Language;
Expand Down
1 change: 0 additions & 1 deletion EasyTranslate.Standalone/EasyTranslate.Standalone.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Dalamud.Libs.targets"/>

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down

0 comments on commit 3e07059

Please sign in to comment.