From bfec6a0cf73debb4dcfa35cd26e9076c6e4b4366 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 1 Dec 2023 11:48:35 +1300 Subject: [PATCH] feat: apply `prettier` to all supported file types (#516) 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 --- .github/workflows/ci.yml | 47 +++++++-------- .github/workflows/codeql-analysis.yml | 57 +++++++++---------- ackama_rails_template.config.yml | 6 +- ci/configs/all-typescript.yml | 6 +- ci/configs/all.yml | 6 +- ci/configs/basic-typescript.yml | 6 +- ci/configs/basic.yml | 6 +- ci/configs/bootstrap-typescript.yml | 6 +- ci/configs/bootstrap.yml | 6 +- .../deploy_with_ackama_ec2_capistrano.yml | 6 +- ci/configs/deploy_with_capistrano.yml | 6 +- ci/configs/devise.yml | 6 +- ci/configs/github_actions.yml | 6 +- ci/configs/react-typescript.yml | 6 +- ci/configs/react.yml | 6 +- ci/configs/sidekiq.yml | 6 +- package.json | 4 +- template.rb | 16 ++++-- variants/backend-base/config/app.yml | 4 +- variants/backend-base/config/pre_commit.yml | 36 ++++++------ variants/backend-base/config/secrets.yml | 9 ++- variants/backend-base/docker-compose.yml | 10 ++-- variants/backend-base/overcommit.yml | 4 +- variants/frontend-base/js-lint/fixes.rb | 8 --- variants/frontend-base/js-lint/template.rb | 4 +- variants/frontend-base/sass-lint.yml | 4 +- .../workflows/deploy_to_ec2.yml | 7 ++- .../workflows/deploy_to_heroku.yml | 7 ++- 28 files changed, 153 insertions(+), 148 deletions(-) delete mode 100644 variants/frontend-base/js-lint/fixes.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f21227e..8c3f6437 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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. # @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e84f87b3..3451df64 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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: @@ -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 diff --git a/ackama_rails_template.config.yml b/ackama_rails_template.config.yml index d0ac3db9..cb044777 100644 --- a/ackama_rails_template.config.yml +++ b/ackama_rails_template.config.yml @@ -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 diff --git a/ci/configs/all-typescript.yml b/ci/configs/all-typescript.yml index 798cd595..75ec764e 100644 --- a/ci/configs/all-typescript.yml +++ b/ci/configs/all-typescript.yml @@ -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 diff --git a/ci/configs/all.yml b/ci/configs/all.yml index 54d07a23..39bad47d 100644 --- a/ci/configs/all.yml +++ b/ci/configs/all.yml @@ -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 diff --git a/ci/configs/basic-typescript.yml b/ci/configs/basic-typescript.yml index 59308ade..09eed26b 100644 --- a/ci/configs/basic-typescript.yml +++ b/ci/configs/basic-typescript.yml @@ -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 diff --git a/ci/configs/basic.yml b/ci/configs/basic.yml index 161725b5..f3c371ae 100644 --- a/ci/configs/basic.yml +++ b/ci/configs/basic.yml @@ -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 diff --git a/ci/configs/bootstrap-typescript.yml b/ci/configs/bootstrap-typescript.yml index 5e524677..b547d676 100644 --- a/ci/configs/bootstrap-typescript.yml +++ b/ci/configs/bootstrap-typescript.yml @@ -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 diff --git a/ci/configs/bootstrap.yml b/ci/configs/bootstrap.yml index f3326bf2..b4029aaf 100644 --- a/ci/configs/bootstrap.yml +++ b/ci/configs/bootstrap.yml @@ -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 diff --git a/ci/configs/deploy_with_ackama_ec2_capistrano.yml b/ci/configs/deploy_with_ackama_ec2_capistrano.yml index a9fd37dc..c90ae2ad 100644 --- a/ci/configs/deploy_with_ackama_ec2_capistrano.yml +++ b/ci/configs/deploy_with_ackama_ec2_capistrano.yml @@ -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 diff --git a/ci/configs/deploy_with_capistrano.yml b/ci/configs/deploy_with_capistrano.yml index efc7ac2c..6ebb9ede 100644 --- a/ci/configs/deploy_with_capistrano.yml +++ b/ci/configs/deploy_with_capistrano.yml @@ -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 diff --git a/ci/configs/devise.yml b/ci/configs/devise.yml index 61e93148..c2edcad0 100644 --- a/ci/configs/devise.yml +++ b/ci/configs/devise.yml @@ -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 diff --git a/ci/configs/github_actions.yml b/ci/configs/github_actions.yml index e5ed645b..44d275fd 100644 --- a/ci/configs/github_actions.yml +++ b/ci/configs/github_actions.yml @@ -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 diff --git a/ci/configs/react-typescript.yml b/ci/configs/react-typescript.yml index bb0daa7b..5fa13dcd 100644 --- a/ci/configs/react-typescript.yml +++ b/ci/configs/react-typescript.yml @@ -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 diff --git a/ci/configs/react.yml b/ci/configs/react.yml index 1dfd4f3b..50034103 100644 --- a/ci/configs/react.yml +++ b/ci/configs/react.yml @@ -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 diff --git a/ci/configs/sidekiq.yml b/ci/configs/sidekiq.yml index 6522ac53..c5f58d08 100644 --- a/ci/configs/sidekiq.yml +++ b/ci/configs/sidekiq.yml @@ -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 diff --git a/package.json b/package.json index d9f044f3..10285a11 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "private": true, "repository": "git@github.com: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": { diff --git a/template.rb b/template.rb index e4f7d490..06fcdbdb 100644 --- a/template.rb +++ b/template.rb @@ -135,6 +135,9 @@ def apply_template! # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Met run "yarn run typecheck" end + # apply any js linting fixes after all frontend variants have run + run "yarn run js-lint-fix" + create_initial_migration # Apply variants after setup and initial install, but before commit @@ -163,8 +166,6 @@ def apply_template! # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Met template "variants/backend-base/rubocop.yml.tt", ".rubocop.yml" run_rubocop_autocorrections - apply "variants/frontend-base/js-lint/fixes.rb" - cleanup_package_json # add the Linux x86-64 platform to the lock file. Gems with native @@ -203,16 +204,24 @@ def apply_template! # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Met # Run the README template at the end because it introspects the app to # discover rake tasks etc. apply_readme_template + + # Run prettier one last time to ensure that everything is formatted + apply_prettier_all_over end end def apply_readme_template template "variants/backend-base/README.md.tt", "README.md", force: true - run "yarn run prettier --write ./README.md" git commit: "README.md -n -m 'Update README'" end +def apply_prettier_all_over + run "yarn run format-fix" + + git commit: ". -m 'Run prettier one last time'" +end + # Normalizes the constraints of the given hash of dependencies so that they # all have an explicit constraint and define a minor & patch version # @@ -250,7 +259,6 @@ def cleanup_package_json File.write("./package.json", JSON.pretty_generate(package_json)) run "npx -y sort-package-json" - run "yarn run prettier --write ./package.json" # ensure the yarn.lock is up to date with any changes we've made to package.json run "yarn install" diff --git a/variants/backend-base/config/app.yml b/variants/backend-base/config/app.yml index 30c82e80..9f96a7b5 100644 --- a/variants/backend-base/config/app.yml +++ b/variants/backend-base/config/app.yml @@ -6,8 +6,8 @@ # Sensitive config should be put in `config/secrets.yml` (which will load it # into `Rails.application.secrets`) -default: &default - # The default `From:` address to use for email sent by this application +default: + &default # The default `From:` address to use for email sent by this application mail_from: "<%= ENV['MAIL_FROM'] %>" development: diff --git a/variants/backend-base/config/pre_commit.yml b/variants/backend-base/config/pre_commit.yml index 3e6aee6d..b4d8ffc8 100644 --- a/variants/backend-base/config/pre_commit.yml +++ b/variants/backend-base/config/pre_commit.yml @@ -1,21 +1,21 @@ --- :checks_remove: [] :checks_add: -- :coffeelint -- :common -- :console_log -- :debugger -- :gemfile_path -- :jshint -- :jslint -- :json -- :merge_conflict -- :migration -- :pry -- :rails -- :rspec_focus -- :ruby -- :scss_lint -- :tabs -- :whitespace -- :yaml + - :coffeelint + - :common + - :console_log + - :debugger + - :gemfile_path + - :jshint + - :jslint + - :json + - :merge_conflict + - :migration + - :pry + - :rails + - :rspec_focus + - :ruby + - :scss_lint + - :tabs + - :whitespace + - :yaml diff --git a/variants/backend-base/config/secrets.yml b/variants/backend-base/config/secrets.yml index 5221109e..f85d2488 100644 --- a/variants/backend-base/config/secrets.yml +++ b/variants/backend-base/config/secrets.yml @@ -11,9 +11,12 @@ default: &default # You can use `rails secret` to generate a secure secret key. secret_key_base: "<%= ENV.fetch('RAILS_SECRET_KEY_BASE') %>" - active_record_encryption_primary_key: "<%= ENV.fetch('ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY') %>" - active_record_encryption_deterministic_key: "<%= ENV.fetch('ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY') %>" - active_record_encryption_key_derivation_salt: "<%= ENV.fetch('ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT') %>" + active_record_encryption_primary_key: + "<%= ENV.fetch('ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY') %>" + active_record_encryption_deterministic_key: + "<%= ENV.fetch('ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY') %>" + active_record_encryption_key_derivation_salt: + "<%= ENV.fetch('ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT') %>" development: <<: *default diff --git a/variants/backend-base/docker-compose.yml b/variants/backend-base/docker-compose.yml index 2aa13fe9..8effcdc6 100644 --- a/variants/backend-base/docker-compose.yml +++ b/variants/backend-base/docker-compose.yml @@ -1,10 +1,10 @@ -version: "2" +version: '2' x-services: rails: &rails build: . environment: - PGHOST: "db" - PGUSER: "postgres" + PGHOST: 'db' + PGUSER: 'postgres' env_file: - .env volumes: @@ -26,11 +26,11 @@ services: environment: WEBPACKER_DEV_SERVER_HOST: shakapacker ports: - - "3000:3000" + - '3000:3000' command: "bash -c 'rm -rf tmp/pid/server.pid && rails s --binding 0.0.0.0'" shakapacker: <<: *rails - command: "./bin/webpack-dev-server" + command: './bin/webpack-dev-server' volumes: pgdata: bundle: diff --git a/variants/backend-base/overcommit.yml b/variants/backend-base/overcommit.yml index d817477a..d5dcef56 100644 --- a/variants/backend-base/overcommit.yml +++ b/variants/backend-base/overcommit.yml @@ -24,7 +24,7 @@ PreCommit: FixMe: enabled: true - keywords: ["FIXME"] + keywords: ['FIXME'] exclude: - .overcommit.yml @@ -41,7 +41,7 @@ PreCommit: TrailingWhitespace: enabled: true exclude: - - "**/db/structure.sql" + - '**/db/structure.sql' YamlSyntax: enabled: true diff --git a/variants/frontend-base/js-lint/fixes.rb b/variants/frontend-base/js-lint/fixes.rb deleted file mode 100644 index 10a33597..00000000 --- a/variants/frontend-base/js-lint/fixes.rb +++ /dev/null @@ -1,8 +0,0 @@ -# this applies the js-linting tools to the app, and so should be run after *all* -# frontend variants have finished running to ensure that we don't cause any -# overrides or miss files - -# must be run after prettier is installed and has been configured by setting -# the 'prettier' key in package.json -run "yarn run js-lint-fix" -run "yarn run format-fix" diff --git a/variants/frontend-base/js-lint/template.rb b/variants/frontend-base/js-lint/template.rb index d976d0ed..1d5809ed 100644 --- a/variants/frontend-base/js-lint/template.rb +++ b/variants/frontend-base/js-lint/template.rb @@ -21,8 +21,8 @@ package_json["scripts"] = { "js-lint" => "eslint . --ignore-pattern '!.eslintrc.js' --ext js,ts,tsx,jsx", "js-lint-fix" => "eslint . --ignore-pattern '!.eslintrc.js' --ext js,ts,tsx,jsx --fix", - "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 .", "scss-lint" => "stylelint '**/*.{css,scss}'", "scss-lint-fix" => "stylelint '**/*.{css,scss}' --fix" } diff --git a/variants/frontend-base/sass-lint.yml b/variants/frontend-base/sass-lint.yml index 00696dad..c2d6d772 100644 --- a/variants/frontend-base/sass-lint.yml +++ b/variants/frontend-base/sass-lint.yml @@ -1,7 +1,7 @@ files: - include: "**/*.s+(a|c)ss" + include: '**/*.s+(a|c)ss' ignore: - - "node_modules/**/*" + - 'node_modules/**/*' options: formatter: stylish # Default rules are visible at diff --git a/variants/github_actions_ci/workflows/deploy_to_ec2.yml b/variants/github_actions_ci/workflows/deploy_to_ec2.yml index 238846ec..81c3d412 100644 --- a/variants/github_actions_ci/workflows/deploy_to_ec2.yml +++ b/variants/github_actions_ci/workflows/deploy_to_ec2.yml @@ -25,7 +25,7 @@ on: slack_username: type: string required: false - default: "Github Actions CI" + default: 'Github Actions CI' secrets: ssh_private_key: required: true @@ -71,6 +71,7 @@ jobs: SLACK_CHANNEL: ${{ inputs.slack_channel }} SLACK_ICON: ${{ inputs.slack_icon }} SLACK_USERNAME: ${{ inputs.slack_username }} - SLACK_FOOTER: "" + SLACK_FOOTER: '' SLACK_COLOR: ${{ job.status }} - SLACK_MESSAGE: "${{ format('{0} job result: {1}', github.job, job.status) }}" + SLACK_MESSAGE: + "${{ format('{0} job result: {1}', github.job, job.status) }}" diff --git a/variants/github_actions_ci/workflows/deploy_to_heroku.yml b/variants/github_actions_ci/workflows/deploy_to_heroku.yml index a73a3067..1873e2a2 100644 --- a/variants/github_actions_ci/workflows/deploy_to_heroku.yml +++ b/variants/github_actions_ci/workflows/deploy_to_heroku.yml @@ -16,7 +16,7 @@ on: slack_username: type: string required: false - default: "Github Actions CI" + default: 'Github Actions CI' secrets: heroku_api_key: required: true @@ -55,6 +55,7 @@ jobs: SLACK_CHANNEL: ${{ inputs.slack_channel }} SLACK_ICON: ${{ inputs.slack_icon }} SLACK_USERNAME: ${{ inputs.slack_username }} - SLACK_FOOTER: "" + SLACK_FOOTER: '' SLACK_COLOR: ${{ job.status }} - SLACK_MESSAGE: "${{ format('{0} job result: {1}', github.job, job.status) }}" + SLACK_MESSAGE: + "${{ format('{0} job result: {1}', github.job, job.status) }}"