Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

chore: add GitHub CI for linting (#222)

blam697472ee9013
diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml
new file mode 100644
index 00000000..8bfc8480
--- /dev/null
+++ b/.github/linters/.yaml-lint.yml
@@ -0,0 +1,57 @@
+---
+###########################################
+# These are the rules used for #
+# linting all the yaml files in the stack #
+# NOTE: #
+# You can disable line with: #
+# # yamllint disable-line #
+###########################################
+rules:
+ braces:
+ level: warning
+ min-spaces-inside: 0
+ max-spaces-inside: 0
+ min-spaces-inside-empty: 1
+ max-spaces-inside-empty: 5
+ brackets:
+ level: warning
+ min-spaces-inside: 0
+ max-spaces-inside: 0
+ min-spaces-inside-empty: 1
+ max-spaces-inside-empty: 5
+ colons:
+ level: warning
+ max-spaces-before: 0
+ max-spaces-after: 1
+ commas:
+ level: warning
+ max-spaces-before: 0
+ min-spaces-after: 1
+ max-spaces-after: 1
+ comments: disable
+ comments-indentation: disable
+ document-end: disable
+ document-start:
+ level: warning
+ present: true
+ empty-lines:
+ level: warning
+ max: 2
+ max-start: 0
+ max-end: 0
+ hyphens:
+ level: warning
+ max-spaces-after: 1
+ indentation:
+ level: warning
+ spaces: consistent
+ indent-sequences: true
+ check-multi-line-strings: false
+ key-duplicates: enable
+ line-length:
+ level: warning
+ max: 80
+ allow-non-breakable-words: true
+ allow-non-breakable-inline-mappings: true
+ new-line-at-end-of-file: disable
+ trailing-spaces: disable
diff --git a/.github/workflows/pull-request-linter.yml b/.github/workflows/pull-request-linter.yml
new file mode 100644
index 00000000..7b8e7e79
--- /dev/null
+++ b/.github/workflows/pull-request-linter.yml
@@ -0,0 +1,23 @@
+---
+name: Pull-Request-Linter
+
+on: pull_request
+
+jobs:
+ super-lint:
+ name: Pull-Request-Linter
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: Run Super Linter
+ uses: github/super-linter@v4
+ env:
+ DEFAULT_BRANCH: master
+ GITHUB_TOKEN: $({ secrets.GITHUB_TOKEN })
+ VALIDATE_CSHARP: true
+ VALIDATE_YAML: true
+ VALIDATE_XML: true
+ VALIDATE_EDITORCONFIG: true
diff --git a/.github/workflows/push-linter.yml b/.github/workflows/push-linter.yml
new file mode 100644
index 00000000..79e5bf5a
--- /dev/null
+++ b/.github/workflows/push-linter.yml
@@ -0,0 +1,24 @@
+---
+name: Push-Linter
+
+on: push
+
+jobs:
+ super-lint:
+ name: Push-Linter
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: Run Super Linter
+ uses: github/super-linter@v4
+ env:
+ VALIDATE_ALL_CODEBASE: false
+ DEFAULT_BRANCH: master
+ GITHUB_TOKEN: $({ secrets.GITHUB_TOKEN })
+ VALIDATE_CSHARP: true
+ VALIDATE_YAML: true
+ VALIDATE_XML: true
+ VALIDATE_EDITORCONFIG: true
diff --git a/GlazeWM.Bar/BarService.cs b/GlazeWM.Bar/BarService.cs
index 69bf1447..d7b98e8a 100644
--- a/GlazeWM.Bar/BarService.cs
+++ b/GlazeWM.Bar/BarService.cs
@@ -6,11 +6,11 @@ using System.Threading;
using System.Windows;
using GlazeWM.Domain.Monitors;
using GlazeWM.Domain.Monitors.Events;
+using GlazeWM.Domain.UserConfigs;
using GlazeWM.Domain.UserConfigs.Events;
using GlazeWM.Infrastructure.Bussing;
using GlazeWM.Infrastructure.Common.Commands;
using static GlazeWM.Infrastructure.WindowsApi.WindowsApiService;
-using GlazeWM.Domain.UserConfigs;
namespace GlazeWM.Bar
{
diff --git a/GlazeWM.Bar/Components/BindingModeComponentViewModel.cs b/GlazeWM.Bar/Components/BindingModeComponentViewModel.cs
index d2998e76..96eef576 100644
--- a/GlazeWM.Bar/Components/BindingModeComponentViewModel.cs
+++ b/GlazeWM.Bar/Components/BindingModeComponentViewModel.cs
@@ -14,7 +14,7 @@ namespace GlazeWM.Bar.Components
private Dispatcher _dispatcher => _parentViewModel.Dispatcher;
private readonly Bus _bus = ServiceLocator.GetRequiredService<Bus>();
private readonly ContainerService _containerService =
- ServiceLocator.GetRequiredService<ContainerService>();
+ ServiceLocator.GetRequiredService<ContainerService>();
/// <summary>
/// Name of the currently active binding mode (if one is active).
diff --git a/GlazeWM.Bar/Components/WorkspacesComponentViewModel.cs b/GlazeWM.Bar/Components/WorkspacesComponentViewModel.cs
index 559b1644..0929e8a9 100644
--- a/GlazeWM.Bar/Components/WorkspacesComponentViewModel.cs
+++ b/GlazeWM.Bar/Components/WorkspacesComponentViewModel.cs
@@ -25,7 +25,7 @@ namespace GlazeWM.Bar.Components
_componentConfig as WorkspacesComponentConfig;
private readonly Bus _bus = ServiceLocator.GetRequiredService<Bus>();
private readonly UserConfigService _userConfigService =
- ServiceLocator.GetRequiredService<UserConfigService>();
+ ServiceLocator.GetRequiredService<UserConfigService>();
public ObservableCollection<Workspace> Workspaces => new(_orderedWorkspaces);
diff --git a/GlazeWM.sln b/GlazeWM.sln
index bd984db0..19d1e392 100644
--- a/GlazeWM.sln
+++ b/GlazeWM.sln
@@ -12,37 +12,37 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GlazeWM.Bootstrapper", "GlazeWM.Bootstrapper\GlazeWM.Bootstrapper.csproj", "{86A11BD4-B17A-4422-9D3A-D2516A730BFE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{877CCE5C-94A9-4CE4-8A29-164179ADE9D3}"
- ProjectSection(SolutionItems) = preProject
- .editorconfig = .editorconfig
- EndProjectSection
+ ProjectSection(SolutionItems) = preProject
+ .editorconfig = .editorconfig
+ EndProjectSection
EndProject
Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {D7741551-9A1D-4357-9571-991C6FDB1906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D7741551-9A1D-4357-9571-991C6FDB1906}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D7741551-9A1D-4357-9571-991C6FDB1906}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D7741551-9A1D-4357-9571-991C6FDB1906}.Release|Any CPU.Build.0 = Release|Any CPU
- {F038C06D-2085-40EA-AEE9-A517231656FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F038C06D-2085-40EA-AEE9-A517231656FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F038C06D-2085-40EA-AEE9-A517231656FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F038C06D-2085-40EA-AEE9-A517231656FC}.Release|Any CPU.Build.0 = Release|Any CPU
- {9FA1F058-7ED2-4BC3-B3BC-C8C43B3C62C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9FA1F058-7ED2-4BC3-B3BC-C8C43B3C62C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9FA1F058-7ED2-4BC3-B3BC-C8C43B3C62C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9FA1F058-7ED2-4BC3-B3BC-C8C43B3C62C5}.Release|Any CPU.Build.0 = Release|Any CPU
- {86A11BD4-B17A-4422-9D3A-D2516A730BFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {86A11BD4-B17A-4422-9D3A-D2516A730BFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {86A11BD4-B17A-4422-9D3A-D2516A730BFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {86A11BD4-B17A-4422-9D3A-D2516A730BFE}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {90AFACCD-B199-4A1E-B14E-5DA783E09D17}
- EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D7741551-9A1D-4357-9571-991C6FDB1906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D7741551-9A1D-4357-9571-991C6FDB1906}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D7741551-9A1D-4357-9571-991C6FDB1906}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D7741551-9A1D-4357-9571-991C6FDB1906}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F038C06D-2085-40EA-AEE9-A517231656FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F038C06D-2085-40EA-AEE9-A517231656FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F038C06D-2085-40EA-AEE9-A517231656FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F038C06D-2085-40EA-AEE9-A517231656FC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9FA1F058-7ED2-4BC3-B3BC-C8C43B3C62C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9FA1F058-7ED2-4BC3-B3BC-C8C43B3C62C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9FA1F058-7ED2-4BC3-B3BC-C8C43B3C62C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9FA1F058-7ED2-4BC3-B3BC-C8C43B3C62C5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {86A11BD4-B17A-4422-9D3A-D2516A730BFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {86A11BD4-B17A-4422-9D3A-D2516A730BFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {86A11BD4-B17A-4422-9D3A-D2516A730BFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {86A11BD4-B17A-4422-9D3A-D2516A730BFE}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {90AFACCD-B199-4A1E-B14E-5DA783E09D17}
+ EndGlobalSection
EndGlobal