Skip to content

Commit

Permalink
Merge pull request #299 from cobbler/feature/enable-prettier
Browse files Browse the repository at this point in the history
Feature: Enable prettier
  • Loading branch information
SchoolGuy authored Sep 2, 2024
2 parents a0e2029 + 450b1be commit ada232b
Show file tree
Hide file tree
Showing 219 changed files with 10,226 additions and 6,613 deletions.
21 changes: 5 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": [
"*.ts"
],
"files": ["*.ts"],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"project": ["tsconfig.json", "e2e/tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
Expand Down Expand Up @@ -45,12 +38,8 @@
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"],
"rules": {}
}
]
Expand Down
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ['bug']
assignees: ''

title: ""
labels: ["bug"]
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ['enhancement']
assignees: ''

title: ""
labels: ["enhancement"]
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
22 changes: 11 additions & 11 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
API-Client:
- projects/cobbler-api/*
- projects/cobbler-api/**/*
- projects/cobbler-api/*
- projects/cobbler-api/**/*

Frontend:
- projects/cobbler-frontend/*
- projects/cobbler-frontend/**/*
- projects/cobbler-frontend/*
- projects/cobbler-frontend/**/*

TS-XMLRPC:
- projects/typescript-xmlrpc/*
- projects/typescript-xmlrpc/**/*
- projects/typescript-xmlrpc/*
- projects/typescript-xmlrpc/**/*

documentation:
- docs-additional/*
- docs-additional/**/*
- docs-additional/*
- docs-additional/**/*

tests:
- '*.spec.ts'
- "*.spec.ts"

dependencies:
- package.json
- package-lock.json
- package.json
- package-lock.json
58 changes: 29 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [main]
schedule:
- cron: '34 17 * * 4'
- cron: "34 17 * * 4"

jobs:
analyze:
Expand All @@ -32,39 +32,39 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/container-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Create and publish a Docker image

on:
push:
branches: ['main']
branches: ["main"]

env:
REGISTRY: ghcr.io
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/coverage-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
# https://github.com/actions/github-script
# Based on: https://github.com/orgs/community/discussions/34652
- name: 'Download artifact'
- name: "Download artifact"
uses: actions/github-script@v7
with:
script: |
Expand Down Expand Up @@ -52,24 +52,24 @@ jobs:
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/coverage-report-xmlrpc.zip`, Buffer.from(downloadXmlRpc.data));
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/coverage-report-api.zip`, Buffer.from(downloadApi.data));
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/coverage-report-frontend.zip`, Buffer.from(downloadFrontend.data));
- name: 'Create folder structure'
- name: "Create folder structure"
run: |
mkdir -p coverage/typescript-xmlrpc
mkdir -p coverage/cobbler-api
mkdir -p coverage/cobbler-frontend
- name: 'Unzip typescript-xmlrpc artifact'
- name: "Unzip typescript-xmlrpc artifact"
run: |
unzip coverage-report-xmlrpc.zip
mv lcov.info coverage/typescript-xmlrpc
- name: 'Unzip cobbler-api artifact'
- name: "Unzip cobbler-api artifact"
run: |
unzip coverage-report-api.zip
mv lcov.info coverage/cobbler-api
- name: 'Unzip cobbler-frontend artifact'
- name: "Unzip cobbler-frontend artifact"
run: |
unzip coverage-report-frontend.zip
mv lcov.info coverage/cobbler-frontend
- name: 'Show filetree'
- name: "Show filetree"
run: |
sudo apt-get install -y tree
tree
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Docs

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
Expand All @@ -30,7 +30,7 @@ jobs:
name: documentation
path: documentation
deploy:
name : Deploy 🚀
name: Deploy 🚀
needs: [build]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
sync-labels: true
repo-token: "${{ secrets.GITHUB_TOKEN }}"
31 changes: 26 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,39 @@ name: Linter

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

# Always use latest Node.js version!

jobs:
lint-prettier:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install deps
run: npm install
- name: Lint with prettier
run: npx prettier . --check
lint-lib-xmlrpc:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Node ${{ matrix.node-version }}
Expand All @@ -34,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Node ${{ matrix.node-version }}
Expand All @@ -55,7 +76,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Node ${{ matrix.node-version }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Tests

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

# Always use latest Node.js version!

Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
path: coverage/cobbler-frontend/lcov.info
if-no-files-found: error
e2e-cobbler-frontend:
if: ${{ false }} # disable for now; we don't have e2e tests currently
if: ${{ false }} # disable for now; we don't have e2e tests currently
runs-on: ubuntu-latest
container:
image: timbru31/node-chrome
Expand Down
2 changes: 0 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
tasks:
- init: npm install && npm run build
command: npm run start


4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore artifacts:
coverage
dist
node_modules
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading

0 comments on commit ada232b

Please sign in to comment.