Skip to content

Conversation

@MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented Mar 26, 2025

Issue

Executing npm run format shows multiple suggested changes, including for *.yml workflows:

  • circle.yml is formatted mostly with a 4 character indent, however this has not been consistently applied
  • factory/docker-compose.yml is formatted with a 2 character indent, with some exceptions

The general Cypress development standard indent is 2 characters, as defined in https://github.com/cypress-io/cypress/blob/b60ac5ee7b84f44a435e304b5d4463a02eabb800/npm/eslint-plugin-dev/lib/index.js#L49-L58

  'indent': [
    'error',
    2,
    {
      // TODO: fix this, we shouldn't need to ignore TemplateLiterals
      'ignoredNodes': ['TemplateLiteral'],
      'SwitchCase': 1,
      'MemberExpression': 0,
    },
  ]

Change

Execute

npx prettier --write "**/*.yml"

to reformat .yml workflows according to Prettier conventions. For clarity of settings, add the following values to .prettierrc. These correspond to Prettier's default values:

  "tabWidth": 2,
  "useTabs": false,

For test-targets I added a dummy comment character # to keep all lists vertically formatted.

Many of the changes are whitespace (indents) only. (Tip: view differences with "Hide whitespace" in GitHub UI.)

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 marked this pull request as ready for review March 26, 2025 15:32
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, much cleaner

@jennifer-shehane jennifer-shehane merged commit fb09410 into cypress-io:master Mar 27, 2025
48 checks passed
@MikeMcC399 MikeMcC399 deleted the prettier-yaml branch March 27, 2025 14:47
MikeMcC399 added a commit to MikeMcC399/cypress-docker-images that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants