diff --git a/.stylelintrc.json b/.stylelintrc.json index 96ec509..49d74f3 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,3 +1,6 @@ { - "extends": "stylelint-config-standard" + "extends": "stylelint-config-standard", + "rules":{ + "color-function-notation": "legacy" + } } diff --git a/Jenkinsfile b/Jenkinsfile index 5e219c9..79a843a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,17 +6,7 @@ pipeline { steps { script { // Check for spaces or mixed indentation - sh ''' - if grep -P "^[ ]+" -r ./**/*.css; then - echo "Error: Files contain spaces instead of tabs for indentation." - exit 1 - fi - if grep -P "^\\t+ +" -r ./**/*.css; then - echo "Error: Files contain mixed tabs and spaces for indentation." - exit 1 - fi - echo "No indentation errors detected." - ''' + sh "./indentcheck.sh" } } } diff --git a/css/theme-flaredefault-auto.css b/css/theme-flaredefault-auto.css index 905e32e..10756a9 100644 --- a/css/theme-flaredefault-auto.css +++ b/css/theme-flaredefault-auto.css @@ -1,2 +1,3 @@ +@import url("./theme-flaredefault-light.css"); @import url("./theme-flaredefault-light.css") (prefers-color-scheme: light); @import url("./theme-flaredefault-dark.css") (prefers-color-scheme: dark); \ No newline at end of file diff --git a/css/theme-flaredefault-dark.css b/css/theme-flaredefault-dark.css index 42b73b2..2ee4c40 100644 --- a/css/theme-flaredefault-dark.css +++ b/css/theme-flaredefault-dark.css @@ -1,4 +1,4 @@ -@import url("./theme-gitea-dark\.css"); +@import url("./theme-gitea-dark.css"); body { background: #333; @@ -10,7 +10,7 @@ body { font-weight: bold; font-size: 150%; border: none; - box-shadow: 0 2px 5px rgb(0 0 0 / 20%); + box-shadow: 0 2px 5px rgba(0, 0, 0, 20%); } .secondary-nav{ @@ -19,16 +19,16 @@ body { } .ui.table, .ui.segments, .ui.segment, #readme, .ui.dashboard-repos, .ui.vertical.menu, .ui.attached.segment, .ui.top.attached.header, #repo-files-table{ - box-shadow: 0 2px 5px rgb(0 0 0 / 20%); + box-shadow: 0 2px 5px rgba(0, 0, 0, 20%); } .repository .diff-detail-box{ margin: 0; - box-shadow: 0 2px 5px rgb(0 0 0 / 20%); + box-shadow: 0 2px 5px rgba(0, 0, 0, 20%); } #diff-file-tree{ - box-shadow: 0 3px 3px rgb(0 0 0 / 20%); + box-shadow: 0 3px 3px rgba(0, 0, 0, 20%); background-color: var(--color-body); z-index: 1000; margin-right: 10px; @@ -39,7 +39,8 @@ body { } .page-footer{ - box-shadow: 0 -2px 5px rgb(0 0 0 / 20%); + background: linear-gradient(#222, #111); + box-shadow: 0 -2px 5px rgba(0, 0, 0, 20%); } .ui.tabular.menu .active.item, .ui.tabular.menu .active.item:hover { diff --git a/css/theme-flaredefault-light.css b/css/theme-flaredefault-light.css index 25fc690..6b80c9b 100644 --- a/css/theme-flaredefault-light.css +++ b/css/theme-flaredefault-light.css @@ -1,7 +1,7 @@ @import url("./theme-gitea-light.css"); body { - background-color: #E0E0E0 !important; + background-color: #E0E0E0; } #navbar{ @@ -10,7 +10,7 @@ body { font-weight: bold; font-size: 150%; border: none; - box-shadow: 0 2px 5px rgb(0 0 0 / 20%); + box-shadow: 0 2px 5px rgba(0, 0, 0, 20%); } .secondary-nav{ @@ -19,16 +19,16 @@ body { } .ui.table, .ui.segments, .ui.segment, #readme, .ui.dashboard-repos, .ui.vertical.menu, .ui.attached.segment, .ui.top.attached.header, #repo-files-table{ - box-shadow: 0 2px 5px rgb(0 0 0 / 20%); + box-shadow: 0 2px 5px rgba(0, 0, 0, 20%); } .repository .diff-detail-box{ margin: 0; - box-shadow: 0 2px 5px rgb(0 0 0 / 20%); + box-shadow: 0 2px 5px rgba(0, 0, 0, 20%); } #diff-file-tree{ - box-shadow: 0 3px 3px rgb(0 0 0 / 20%); + box-shadow: 0 3px 3px rgba(0, 0, 0, 20%); background-color: var(--color-body); z-index: 1000; margin-right: 10px; @@ -40,7 +40,7 @@ body { .page-footer{ background: linear-gradient(#EFEFEF, #DEDEDE); - box-shadow: 0 -2px 5px rgb(0 0 0 / 20%); + box-shadow: 0 -2px 5px rgba(0, 0, 0, 20%); } .ui.tabular.menu .active.item, .ui.tabular.menu .active.item:hover { diff --git a/indentcheck.sh b/indentcheck.sh new file mode 100755 index 0000000..0003ede --- /dev/null +++ b/indentcheck.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Save the results of the find command into a variable +FILETYPES="css|json|js|java|py|ps1|cs|cmd|bat|htm|html|cpp|c|h|hpp|sh|bash" +FILES=$(find . -regextype awk -regex ".*\.($FILETYPES)" -type f) +# Initialize the PROBLEMS variable +PROBLEMS="" + +# Pass the files to grep and sed +for file in $FILES; do + # Check for lines with spaces + GREP_RESULT=$(grep -nrP '^[ ]+' "$file") + if [ -n "$GREP_RESULT" ]; then + PROBLEMS="${PROBLEMS}Space indentation in file $file:"$'\n'"$GREP_RESULT"$'\n\n\n' # Append the result to PROBLEMS + fi + + # Check for lines with mixed tabs and spaces + GREP_RESULT=$(grep -nrP '^\t+ +' "$file") + if [ -n "$GREP_RESULT" ]; then + PROBLEMS="${PROBLEMS}Mixed indentation in file $file:"$'\n'"$GREP_RESULT"$'\n\n\n' # Append the result to PROBLEMS + fi +done + +# Check if there were any problems +if [ -n "$PROBLEMS" ]; then + echo "Indentation issues detected. Please fix the above lines." + echo "$PROBLEMS" + exit 1 +else + echo "No indentation issues detected." + exit 0 +fi