Compare commits
6 Commits
4a673d1894
...
0.1.1
Author | SHA1 | Date | |
---|---|---|---|
64efaf5514 | |||
8d320f96cd | |||
75c5e7ea4c | |||
e6e668451a | |||
9528fca452 | |||
cf95ee2acb |
@@ -7,17 +7,19 @@ on:
|
||||
|
||||
name: SonarQube Scan
|
||||
jobs:
|
||||
sonarqube:
|
||||
name: SonarQube Trigger
|
||||
build:
|
||||
name: Build and analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checking out
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||
fetch-depth: 0
|
||||
- name: SonarQube Scan
|
||||
uses: kitabisa/sonarqube-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.SONARQUBE_HOST }}
|
||||
login: ${{ secrets.SONARQUBE_TOKEN }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- uses: SonarSource/sonarqube-scan-action@v4
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||
- uses: SonarSource/sonarqube-quality-gate-action@v1
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
@@ -1,5 +1,7 @@
|
||||
# gosearch
|
||||
|
||||
[](https://sonar.dev-null.rocks/dashboard?id=gosearch)
|
||||
|
||||
### Diagram of the Architecture
|
||||
|
||||
```mermaid
|
||||
|
@@ -2,6 +2,7 @@ package http
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/log"
|
||||
"github.com/gofiber/fiber/v2/middleware/logger"
|
||||
)
|
||||
|
||||
@@ -12,6 +13,7 @@ func StartService() {
|
||||
app.Use(logger.New(logger.Config{
|
||||
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
|
||||
}))
|
||||
log.SetLevel(log.LevelInfo)
|
||||
|
||||
// Configure Routes
|
||||
app = configureRoutes(app)
|
||||
|
@@ -87,7 +87,7 @@ func AddDocToIndex(url string, content string) {
|
||||
scanner.Split(bufio.ScanWords)
|
||||
|
||||
for scanner.Scan() {
|
||||
word := strings.ToLower(strings.Trim(scanner.Text(), ",.!?"))
|
||||
word := strings.ToLower(strings.Trim(scanner.Text(), ",.!?&<>;:=§$%{}[]()|"))
|
||||
|
||||
if Index[word] == nil {
|
||||
Index[word] = make(map[string]int)
|
||||
@@ -100,7 +100,7 @@ func AddDocToIndex(url string, content string) {
|
||||
}
|
||||
}
|
||||
|
||||
updateIndex("default")
|
||||
go updateIndex("default")
|
||||
}
|
||||
|
||||
func writeStructToFile(filename string, data interface{}) error {
|
||||
|
1
sonar-project.properties
Normal file
1
sonar-project.properties
Normal file
@@ -0,0 +1 @@
|
||||
sonar.projectKey=gosearch
|
Reference in New Issue
Block a user