diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml new file mode 100644 index 0000000..e9ca9c8 --- /dev/null +++ b/.github/workflows/linter.yaml @@ -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/super-linter@v6.1.1 # 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 + + + +... \ No newline at end of file diff --git a/Linter_Documentation/.eslintrc.json b/Linter_Documentation/.eslintrc.json new file mode 100644 index 0000000..2c11652 --- /dev/null +++ b/Linter_Documentation/.eslintrc.json @@ -0,0 +1,12 @@ +{ + "parser": "babel-eslint", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true, + "modules": true, + "experimentalObjectRestSpread": true + } + } +} \ No newline at end of file diff --git a/Linter_Documentation/Step1_linter.png b/Linter_Documentation/Step1_linter.png new file mode 100644 index 0000000..11fc0f8 Binary files /dev/null and b/Linter_Documentation/Step1_linter.png differ diff --git a/Linter_Documentation/Step2_linter.png b/Linter_Documentation/Step2_linter.png new file mode 100644 index 0000000..9834ce4 Binary files /dev/null and b/Linter_Documentation/Step2_linter.png differ diff --git a/Linter_Documentation/Step3_linter.png b/Linter_Documentation/Step3_linter.png new file mode 100644 index 0000000..478e18d Binary files /dev/null and b/Linter_Documentation/Step3_linter.png differ diff --git a/Linter_Documentation/Step4_linter.png b/Linter_Documentation/Step4_linter.png new file mode 100644 index 0000000..b42a1c1 Binary files /dev/null and b/Linter_Documentation/Step4_linter.png differ diff --git a/NewController.cs b/NewController.cs new file mode 100644 index 0000000..b7efd90 --- /dev/null +++ b/NewController.cs @@ -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 _logger; +public NewController(ILogger logger) + { + _logger = logger; + } + + public IActionResult Index() + { + return View(); + } + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View("Error!"); + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index 3ea83b3..d7fb6c1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # GCS Database API This is the primary codebase for the GCS database and its API. +
![Super-Linter](https://github.com/Northrop-Grumman-Collaboration-Project/gcs-database-api/actions/workflows/linter.yaml/badge.svg) ## To Set up WebSocket: @@ -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 @@ -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 ``` /** @@ -60,4 +71,5 @@ public class MyClass { } * Describe return value.