Skip to content

Linter #31

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

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
db0779d
workflow linter
Skyhorizon2021 Feb 16, 2024
36b9f2f
workflow test
Skyhorizon2021 Feb 16, 2024
d33f150
update workflow
Skyhorizon2021 Feb 16, 2024
2fe532b
deleted test file
Skyhorizon2021 Feb 16, 2024
a1dddf5
added test file
Skyhorizon2021 Feb 16, 2024
3028511
created github workflow
Skyhorizon2021 Feb 23, 2024
99cfe6f
testing linter
Skyhorizon2021 Feb 23, 2024
9d7d225
add output folder
Skyhorizon2021 Feb 23, 2024
d27b4e8
Merge branch 'main' of https://github.com/Northrop-Grumman-Collaborat…
Skyhorizon2021 Feb 23, 2024
dac3177
changed top-level permission for workflow file
Skyhorizon2021 Feb 23, 2024
c8a9363
Update README.md
Skyhorizon2021 Feb 23, 2024
1be8856
Update README.md
Skyhorizon2021 Feb 23, 2024
fd20b17
Update README.md
Skyhorizon2021 Feb 23, 2024
2cc3740
configure workflow to not lint certain file type
Skyhorizon2021 Mar 1, 2024
8f5691d
Merge branch 'linter' of https://github.com/Northrop-Grumman-Collabor…
Skyhorizon2021 Mar 1, 2024
952f845
testing commit
Skyhorizon2021 Mar 1, 2024
0f7aeb2
removed testing element
Skyhorizon2021 Mar 1, 2024
97ecd35
Merge branch 'main' into linter
Skyhorizon2021 Mar 1, 2024
400a9fb
Merge branch 'main' into linter
Skyhorizon2021 Mar 22, 2024
daf752f
changed parser for JSON file
Skyhorizon2021 Mar 22, 2024
878661d
Update README.md
Skyhorizon2021 Mar 22, 2024
18d8d05
Update README.md
Skyhorizon2021 Mar 22, 2024
3e12f96
added graphic for documentation
Skyhorizon2021 Mar 22, 2024
95b2f5a
Merge branch 'linter' of https://github.com/Northrop-Grumman-Collabor…
Skyhorizon2021 Mar 22, 2024
0363e62
Update README.md
Skyhorizon2021 Mar 22, 2024
27e2932
Update README.md
Skyhorizon2021 Mar 22, 2024
e465e12
Update README.md
Skyhorizon2021 Mar 22, 2024
f0d5be5
Update README.md
Skyhorizon2021 Mar 22, 2024
c72202d
Update README.md
Skyhorizon2021 Mar 22, 2024
ac0c2d5
Update README.md
Skyhorizon2021 Mar 22, 2024
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
46 changes: 46 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Lint

on: # yamllint disable-line rule:truthy
push:
branches-ignore: [origin/main]
pull_request:
branches: [origin/main]

permissions: read-all
jobs:
build:
name: Lint
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0

- name: Lint Code Base
uses: super-linter/[email protected] # x-release-please-version
env:
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT_FOLDER: Linter_Report
OUTPUT_DETAILS: detailed

#only check for changed file
#VALIADATE_ALL_CODEBASE: false
#ignore linting for certain file type
VALIDATE_ENV: false
VALIDATE_MARKDOWN: false



...
12 changes: 12 additions & 0 deletions Linter_Documentation/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true,
"experimentalObjectRestSpread": true
}
}
}
Binary file added Linter_Documentation/Step1_linter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linter_Documentation/Step2_linter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linter_Documentation/Step3_linter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linter_Documentation/Step4_linter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions NewController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace gcs-database-api
{
[Route("[controller]")]
public class NewController : Controller
{
private readonly ILogger<NewController> _logger;
public NewController(ILogger<NewController> logger)
{
_logger = logger;
}

public IActionResult Index()
{
return View();
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View("Error!");
}
}
}
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# GCS Database API

This is the primary codebase for the GCS database and its API.
<br>![Super-Linter](https://github.com/Northrop-Grumman-Collaboration-Project/gcs-database-api/actions/workflows/linter.yaml/badge.svg)

## To Set up WebSocket:

Expand All @@ -10,7 +11,7 @@ This is the primary codebase for the GCS database and its API.
4. In vscode, open a terminal (if not already open, press Crtl + \` or Command + \`)
5. Check Dependencies
5a. Make sure you have .NET installed (https://dotnet.microsoft.com/en-us/download/dotnet/7.0)
5b. Make sure you have Node js installed (https://nodejs.org/en/download)
5b. Make sure you have Node.js installed (https://nodejs.org/en/download)
5c. Make sure you have NuGet packet manager extension installed in vscode
5d. In vscode, Crtl/Command + Shift + P -> NuGet: Open NuGet Gallery
5e. Search and install StackExchange.Redis
Expand Down Expand Up @@ -38,6 +39,16 @@ For Docker Setup:

## [Documentation comments](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/)

## Linting Log Interpretation
1. Select the workflow symbol near the top of the codebase to see a summary of the lint
![Workflow Symbol](https://github.com/Northrop-Grumman-Collaboration-Project/gcs-database-api/blob/linter/Linter_Documentation/Step1_linter.png)
2. To see more details on why the lint failed for specific programming languages, select the "Details" option
![Summary of Lint](https://github.com/Northrop-Grumman-Collaboration-Project/gcs-database-api/blob/linter/Linter_Documentation/Step2_linter.png)
3. Upon landing in the detailed workflow page, check which languages failed the lint. Select the dropdown option to see which line(s) in which file(s) failed the lint
![Detailed page of failed lint for specific languages](https://github.com/Northrop-Grumman-Collaboration-Project/gcs-database-api/blob/linter/Linter_Documentation/Step3_linter.png)
4. Lastly, examine what error the code yield in the listed file(s). The first number indicates the line number, the second is the character number within that file.
![Detailed page of which line in which file contained the linting error](https://github.com/Northrop-Grumman-Collaboration-Project/gcs-database-api/blob/linter/Linter_Documentation/Step4_linter.png)

### Summary
```
/**
Expand All @@ -60,4 +71,5 @@ public class MyClass { }
* <returns>Describe return value.</returns
*/
public int SomeMethod(int i, void* ptr) {return 1;}
```
```
main