Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up pre-commit for running hooks and tasks such as linting. #11

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
README.md
27 changes: 13 additions & 14 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@ name: .NET

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- 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@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [scss, yaml, markdown, javascript]

- repo: https://github.com/dotnet/format
rev: v8.0.453106
hooks:
- id: dotnet-format
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/Pages/Error.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
</p>
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/Pages/Error.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public IndexModel(ILogger<IndexModel> logger)

public void OnGet()
{

}
}
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/Pages/Privacy.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
}
<h1>@ViewData["Title"]</h1>

<p>Use this page to detail your site's privacy policy.</p>
<p>Use this page to detail your site's privacy policy.</p>
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/Pages/Privacy.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ public PrivacyModel(ILogger<PrivacyModel> logger)
public void OnGet()
{
}
}
}
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@

@await RenderSectionAsync("Scripts", required: false)
</body>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/Pages/_ViewImports.cshtml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@using Dfsseta.ApplyForLanding
@namespace Dfsseta.ApplyForLanding.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/Pages/_ViewStart.cshtml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@{
Layout = "_Layout";
}
}
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

app.MapRazorPages();

app.Run();
app.Run();
2 changes: 1 addition & 1 deletion src/Dfsseta.ApplyForLanding/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ html {

body {
margin-bottom: 60px;
}
}
Loading