Skip to content

Commit

Permalink
Merge pull request #39 from NHSDigital/rossbugginsnhs/test-sonar
Browse files Browse the repository at this point in the history
Rossbugginsnhs/test sonar
  • Loading branch information
RossBugginsNHS authored Jun 17, 2024
2 parents 4f295ba + 41ea272 commit c5aac33
Show file tree
Hide file tree
Showing 25 changed files with 514 additions and 90 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ indent_size = 4

[{Makefile,*.mk,go.mod,go.sum,*.go,.gitmodules}]
indent_style = tab

# Ignore paths
[Gemfile.lock]
charset = unset
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_style = unset
indent_size = unset
generated_code = true
6 changes: 5 additions & 1 deletion .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ jobs:
- name: Display structure of downloaded files
run: ls -R
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
uses: SonarSource/sonarcloud-github-action@v2.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=${{ vars.SONAR_ORGANISATION_KEY }}
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
# Deployment job
deploy:
environment:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,14 @@ jobs:
with:
fetch-depth: 0 # Full history is needed to improving relevancy of reporting
- name: Stage 2 Test - Sonar Cloud Scan
uses: SonarSource/sonarcloud-github-action@master
uses: SonarSource/sonarcloud-github-action@v2.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=${{ vars.SONAR_ORGANISATION_KEY }}
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
# - name: "Perform static analysis"
# uses: ./.github/actions/perform-static-analysis
# with:
Expand Down
10 changes: 7 additions & 3 deletions docs/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"request": "launch",
"runtimeArgs": ["run-script", "debug"],
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**"],
"type": "node",
"request": "attach",
"name": "Attach",
"preLaunchTask": "jekyll"
"preLaunchTask": "stop-already-running",
"console": "integratedTerminal"
}
]
}
6 changes: 3 additions & 3 deletions docs/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"version": "2.0.0",
"tasks": [
{
"label": "jekyll",
"label": "stop-already-running",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "make debug",
},
"command": "kill $(lsof -ti :4000); exit 0;",
"type": "shell"
}
]
Expand Down
1 change: 1 addition & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

gem "just-the-docs"
gem 'jemoji'
29 changes: 28 additions & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.3.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.2.0)
bigdecimal (3.1.8)
cgi (0.4.1)
colorator (1.1.0)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
drb (2.2.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
Expand All @@ -14,7 +28,11 @@ GEM
eventmachine (1.2.7)
ffi (1.16.3)
forwardable-extended (2.6.0)
gemoji (4.1.0)
google-protobuf (3.25.3-x86_64-linux)
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -48,6 +66,10 @@ GEM
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.13.0)
gemoji (>= 3, < 5)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
just-the-docs (0.8.2)
jekyll (>= 3.8.5)
jekyll-include-cache
Expand All @@ -66,6 +88,8 @@ GEM
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.23.1)
mutex_m (0.2.0)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
Expand All @@ -86,6 +110,8 @@ GEM
strscan (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webrick (1.8.1)

Expand All @@ -97,11 +123,12 @@ DEPENDENCIES
jekyll (~> 4.3.3)
jekyll-drawio
jekyll-feed (~> 0.12)
jemoji
just-the-docs
minima (~> 2.5)
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1.1)

BUNDLED WITH
2.5.10
2.5.10
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ just_the_docs:
theme: just-the-docs
plugins:
- jekyll-feed
- jemoji

color_scheme: nhs
mermaid:
Expand Down
3 changes: 3 additions & 0 deletions docs/_includes/fullscreen.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<button type="button" name="fullScreenButton" id="fullScreenButton" class="btn" onclick="fullScreenToggle()">
Full Screen View
</button>
1 change: 1 addition & 0 deletions docs/_includes/nhs-notify-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script src="{{ '/assets/js/nhs-notify.js' | relative_url }}"></script>
102 changes: 52 additions & 50 deletions docs/_includes/page-info-header.html
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
{% if page.is_not_draft %}{% else %} {% assign is_draft = true %} {% endif %} {%
assign wordWarning = 200 %} {% assign wordCount = content | number_of_words%} {%
assign readTime = wordCount | divided_by: 100.0 | ceil %} {% if page.sub_title
%}
<h1>{{ page.title }}</h1>
<p class="text-medium text-grey-dk-300 mb-0">{{ page.summary }}</p>
{% else %}
<h1>{{ page.title }}</h1>
{% endif %}
assign wordWarning = 200 %} {% assign wordCount = content | number_of_words%} {%
assign readTime = wordCount | divided_by: 100.0 | ceil %} {% if page.sub_title
%}
<h1>{{ page.title }}</h1>
<p class="text-medium text-grey-dk-300 mb-0">{{ page.summary }}</p>
{% else %}
<h1>{{ page.title }}</h1>
{% endif %}

<div class="page-info">
<p class="text-small text-grey-dk-300 mb-0">
{% if page.last_modified_date %} {{ page.last_modified_date | date:
"%Y-%m-%d"}} | {% else %} 2022-07-01 | {% endif %} 📑 {{ wordCount }} words
| ⏱ {{readTime}} mins {% if site.gh_edit_link and site.gh_edit_link_text and
site.gh_edit_repository and site.gh_edit_branch and site.gh_edit_view_mode
%} |
<a
href="{{ site.gh_edit_repository }}/commits/{{ site.gh_edit_branch }}{% if site.gh_edit_source %}/{{ site.gh_edit_source }}{% endif %}/{{ page.path }}"
id="edit-this-page"
>🧾 History</a
>
<div class="page-info">
<p class="text-small text-grey-dk-300 mb-0">
{% if page.last_modified_date %} {{ page.last_modified_date | date:
"%Y-%m-%d"}} | {% else %} 2022-07-01 | {% endif %} 📑 {{ wordCount }} words
| ⏱ {{readTime}} mins {% if site.gh_edit_link and site.gh_edit_link_text and
site.gh_edit_repository and site.gh_edit_branch and site.gh_edit_view_mode
%} |
<a
href="{{ site.gh_edit_repository }}/commits/{{ site.gh_edit_branch }}{% if site.gh_edit_source %}/{{ site.gh_edit_source }}{% endif %}/{{ page.path }}"
id="edit-this-page"
>🧾 History</a
>

{% endif %} | {% if page.author %} ✍ {{page.author}} {% else %} ✍ Ross
Buggins {% endif %} | {% if page.owner %} 🔑 {{page.owner}} {% else %} 🔑
Ross Buggins {% endif %}
</p>
{% endif %} | {% if page.author %} ✍ {{page.author}} {% else %} ✍ Ross
Buggins {% endif %} | {% if page.owner %} 🔑 {{page.owner}} {% else %} 🔑
Ross Buggins {% endif %}

<p class="text-small text-grey-dk-300 mb-0">
{% for tag in page.tags %}<a class="text-small" href="/tags/{{tag}}.html"
>{{tag}}</a
>,{% endfor %}
</p>
<p class="text-small text-grey-dk-300 mb-0">
{% for tag in page.tags %}<a class="text-small" href="/tags/{{tag}}.html"
>{{tag}}</a
>,{% endfor %}
</p>

{% if wordCount < wordWarning %}
<p class="text-small text-grey-dk-300 mb-0">
🚧 This page has less that {{wordWarning}} words. So it looks like this page
is still under construction.
</p>
{% endif %} {% if page.description %}
<p class="text-grey-dk-300 mb-0"><i>{{page.description}}</i></p>
{% endif %} {% if page.todo or is_draft %}
<p class="text-small text-grey-dk-300 mb-0"><b>Known Issues / Todo</b></p>
{% if wordCount < wordWarning %}
<p class="text-small text-grey-dk-300 mb-0">
🚧 This page has less that {{wordWarning}} words. So it looks like this page
is still under construction.
</p>
{% endif %} {% if page.description %}
<p class="text-grey-dk-300 mb-0"><i>{{page.description}}</i></p>
{% endif %} {% if page.todo or is_draft %}
<p class="text-small text-grey-dk-300 mb-0"><b>Known Issues / Todo</b></p>

<ul>
{% if page.is_not_draft %}{% else %}
<li class="text-small text-grey-dk-300 mb-0">
<b>This page is draft</b> and is subject to rapid change, and may not
be fully accurate or complete
</li>
{% endif %} {% for todo in page.todo %}
<li class="text-small text-grey-dk-300 mb-0">{{todo}}</li>
{% endfor %}
</ul>
{% endif %}
</div>
<ul>
{% if page.is_not_draft %}{% else %}
<li class="text-small text-grey-dk-300 mb-0">
<b>This page is draft</b> and is subject to rapid change, and may not
be fully accurate or complete
</li>
{% endif %} {% for todo in page.todo %}
<li class="text-small text-grey-dk-300 mb-0">{{todo}}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% include fullscreen.html %}
</p>
<div></div>
22 changes: 14 additions & 8 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@

<html lang="{{ site.lang | default: 'en-US' }}">
{% include head.html %}
{% include nhs-notify-head.html %}

<body>
<a class="skip-to-main" href="#main-content">Skip to main content</a>
{% include icons/icons.html %}
{% if page.nav_enabled == true %}
{% include components/sidebar.html %}
{% include components/sidebar.html %}
{% elsif layout.nav_enabled == true and page.nav_enabled == nil %}
{% include components/sidebar.html %}
{% include components/sidebar.html %}
{% elsif site.nav_enabled != false and layout.nav_enabled == nil and page.nav_enabled == nil %}
{% include components/sidebar.html %}
{% include components/sidebar.html %}
{% endif %}
<div class="main" id="top">
{% include components/header.html %}
Expand All @@ -23,25 +25,29 @@
<div id="main-content" class="main-content">
<main>
{% if site.heading_anchors != false %}
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16
16\" aria-hidden=\"true\">
<use xlink:href=\"#svg-link\"></use>
</svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
{% else %}
{{ content }}
{{ content }}
{% endif %}

{% if page.has_children == true and page.has_toc != false %}
{% include components/children_nav.html %}
{% include components/children_nav.html %}
{% endif %}
</main>
{% include components/footer.html %}
</div>
</div>
{% if site.search_enabled != false %}
{% include components/search_footer.html %}
{% include components/search_footer.html %}
{% endif %}
</div>

{% if site.mermaid %}
{% include components/mermaid.html %}
{% include components/mermaid.html %}
{% endif %}
</body>

</html>
Loading

0 comments on commit c5aac33

Please sign in to comment.