Skip to content

Commit

Permalink
feat: apply prettier to all supported file types (#516)
Browse files Browse the repository at this point in the history
We originally limited the files we applied `prettier` to a subset (which
I think is really just "not yaml"?) when we first started using it, but
I think nowdays we're all very comfortable with it and we don't have
anything else linting our YAML so lets starting doing that
  • Loading branch information
G-Rath authored Nov 30, 2023
1 parent 2c31cef commit bfec6a0
Show file tree
Hide file tree
Showing 28 changed files with 153 additions and 148 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
schedule:
# * is a special character in YAML so you have to quote this string
# * At 05:00 UTC every Monday, run the latest commit on the default or base branch
- cron: '0 5 * * MON'
- cron: '0 5 * * MON'

# Restrict jobs in this workflow to only be allowed to read this repo by default.
#
Expand All @@ -35,8 +35,8 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version-file: ".node-version"
cache: "yarn"
node-version-file: '.node-version'
cache: 'yarn'
- run: yarn install
- run: yarn run format-check

Expand Down Expand Up @@ -64,36 +64,36 @@ jobs:
matrix:
variant:
- name: defaults
config_path: "ackama_rails_template.config.yml"
config_path: 'ackama_rails_template.config.yml'
- name: all
config_path: "ci/configs/all.yml"
config_path: 'ci/configs/all.yml'
- name: all-typescript
config_path: "ci/configs/all-typescript.yml"
config_path: 'ci/configs/all-typescript.yml'
- name: basic
config_path: "ci/configs/basic.yml"
config_path: 'ci/configs/basic.yml'
- name: basic-typescript
config_path: "ci/configs/basic-typescript.yml"
config_path: 'ci/configs/basic-typescript.yml'
- name: github_actions
config_path: "ci/configs/github_actions.yml"
config_path: 'ci/configs/github_actions.yml'
- name: react
config_path: "ci/configs/react.yml"
config_path: 'ci/configs/react.yml'
- name: react-typescript
config_path: "ci/configs/react-typescript.yml"
config_path: 'ci/configs/react-typescript.yml'
- name: sidekiq
config_path: "ci/configs/sidekiq.yml"
config_path: 'ci/configs/sidekiq.yml'
- name: devise
config_path: "ci/configs/devise.yml"
config_path: 'ci/configs/devise.yml'
- name: basic_with_skips
config_path: "ci/configs/basic.yml"
config_path: 'ci/configs/basic.yml'
skips: --skip-spring --skip-javascript
- name: bootstrap
config_path: "ci/configs/bootstrap.yml"
config_path: 'ci/configs/bootstrap.yml'
- name: bootstrap-typescript
config_path: "ci/configs/bootstrap-typescript.yml"
config_path: 'ci/configs/bootstrap-typescript.yml'
- name: capistrano
config_path: "ci/configs/deploy_with_capistrano.yml"
config_path: 'ci/configs/deploy_with_capistrano.yml'
- name: ackama_ec2_capistrano
config_path: "ci/configs/deploy_with_ackama_ec2_capistrano.yml"
config_path: 'ci/configs/deploy_with_ackama_ec2_capistrano.yml'
services:
db:
image: postgres
Expand All @@ -104,6 +104,7 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: anything # can be anything, is ignored by the tests
ports: ['5432:5432']
# prettier-ignore
options: >-
--health-cmd pg_isready
--health-interval 10s
Expand All @@ -117,14 +118,14 @@ jobs:
persist-credentials: false

# this ensures that osv-detector is available for running bin/ci-run
- name: Check dependencies for security vulnerabilities (and setup osv-detector)
- name: Check dependencies for vulnerabilities (and setup osv-detector)
uses: g-rath/check-with-osv-detector@main

- name: Install NodeJS
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version-file: ".node-version"
cache: 'yarn'
node-version-file: '.node-version'

# We don't cache gems or JS packages because we are actually testing how
# installation and setup works in this project so, while caching would
Expand All @@ -149,8 +150,8 @@ jobs:
# with a class provided by a gem. Basically, don't name your app
# "react", "sidekiq" etc.
APP_NAME: ${{ matrix.variant.name }}-demo
CONFIG_PATH: ${{ matrix.variant.config_path }}
SKIPS: "--skip-javascript --skip-docker ${{ matrix.variant.skips }}"
CONFIG_PATH: ${{ matrix.variant.config_path }}
SKIPS: '--skip-javascript --skip-docker ${{ matrix.variant.skips }}'
PGUSER: postgres
PGPASSWORD: postgres
PGHOST: localhost
Expand Down
57 changes: 28 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
name: 'CodeQL'

on:
push:
Expand All @@ -26,41 +26,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'typescript', 'javascript', 'ruby' ]
language: ['typescript', 'javascript', 'ruby']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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.


# 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@v2
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# 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@v2

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
6 changes: 3 additions & 3 deletions ackama_rails_template.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#
# Set these to "" if you don't know the values.
#
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''

# Use TypeScript for any JavaScript-based code
use_typescript: true
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/all-typescript.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: true
apply_variant_github_actions_ci: true
apply_variant_react: true
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/all.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: false
apply_variant_github_actions_ci: true
apply_variant_react: true
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/basic-typescript.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: true
apply_variant_github_actions_ci: false
apply_variant_react: false
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/basic.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: false
apply_variant_github_actions_ci: false
apply_variant_react: false
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/bootstrap-typescript.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: true
apply_variant_github_actions_ci: false
apply_variant_react: false
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: false
apply_variant_github_actions_ci: false
apply_variant_react: false
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/deploy_with_ackama_ec2_capistrano.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: false
apply_variant_react: false
apply_variant_devise: false
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/deploy_with_capistrano.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: false
apply_variant_github_actions_ci: false
apply_variant_react: false
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/devise.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
apply_variant_github_actions_ci: false
use_typescript: false
apply_variant_react: false
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/github_actions.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: false
apply_variant_github_actions_ci: true
apply_variant_react: false
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/react-typescript.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: true
apply_variant_github_actions_ci: false
apply_variant_react: true
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/react.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: false
apply_variant_github_actions_ci: false
apply_variant_react: true
Expand Down
6 changes: 3 additions & 3 deletions ci/configs/sidekiq.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
staging_hostname: "staging.example.com"
production_hostname: "www.example.com"
git_repo_url: ""
staging_hostname: 'staging.example.com'
production_hostname: 'www.example.com'
git_repo_url: ''
use_typescript: false
apply_variant_github_actions_ci: false
apply_variant_react: false
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"repository": "[email protected]:ackama/rails-template.git",
"scripts": {
"format-check": "prettier --check './**/*.{css,scss,json,md,js,ts,tsx,jsx}'",
"format-fix": "prettier --write './**/*.{css,scss,json,md,js,ts,tsx,jsx}'"
"format-check": "prettier --check .",
"format-fix": "prettier --write ."
},
"prettier": "prettier-config-ackama",
"devDependencies": {
Expand Down
Loading

0 comments on commit bfec6a0

Please sign in to comment.