Skip to content

CLDSRV-1002: format the whole codebase with prettier - #6297

Open
DarkIsDude wants to merge 5 commits into
development/9.3from
improvement/CLDSRV-1002/prettier-whole-repo
Open

DarkIsDude wants to merge 5 commits into
development/9.3from
improvement/CLDSRV-1002/prettier-whole-repo

Conversation

@DarkIsDude

Copy link
Copy Markdown
Contributor

Motivation and context

Prettier has only ever been checked on the files a PR touches, so the codebase
was being reformatted a few files at a time and most of it was still
unformatted. The RRR of Sep 7, 2026 concluded we should stop spreading it out
and do it in one go, so that formatting noise never lands in a review again.

Base is development/9.3 because that is the earliest branch that has the
Prettier tooling (60bb2134); 9.4 and 9.5 inherit it by forward merge.

What changed

Two commits, in this order:

  1. 👷 check prettier formatting on the whole repo — the CI job runs
    prettier --check . instead of diffing against the merge base.
    scripts/prettier-diff.sh and the prettier:diff script are gone, replaced
    by prettier:check and prettier:write. ESLint's max-len is turned off:
    it duplicates Prettier's printWidth and disagrees with it on ~14 lines
    Prettier cannot break (long string literals). The 12 now-dead
    eslint-disable max-len directives are removed with it.

  2. 🎨 format the whole codebase with prettier — 564 files, the plain
    output of yarn prettier:write, no manual edit on top.

Review the first commit; the second is mechanical.

Verification

  • yarn prettier:check — clean
  • yarn lint — 0 errors, 2947 warnings, identical to development/9.3
  • yarn test — 5156 passing, 5 pending

Related issues

https://scality.atlassian.net/browse/CLDSRV-1002

Prettier now owns line length, so drop the eslint max-len rule it
conflicts with and the disable directives that went with it.

Issue: CLDSRV-1002
Generated with `yarn prettier:write`, no manual edit.

Issue: CLDSRV-1002
@DarkIsDude DarkIsDude self-assigned this Sep 21, 2026
@bert-e

bert-e commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Hello darkisdude,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/bypass_source_branch_lineage Bypass the cross-branch contamination check
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e

This comment was marked as resolved.

@DarkIsDude

Copy link
Copy Markdown
Contributor Author

/create_pull_requests

@bert-e

This comment was marked as resolved.

@bert-e

This comment was marked as resolved.

@bert-e

This comment was marked as resolved.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@codecov

This comment was marked as off-topic.

@bert-e

This comment was marked as resolved.

Prettier pads markdown table cells for alignment, which pushed this table
to 82 columns and tripped MD013. mdlint's config lives in the shared
Guidelines package and cannot be relaxed per repo, so shorten the widest
cell instead.

Issue: CLDSRV-1002
websiteHead.js and websiteHeadWithACL.js assert the ETag of index.html,
so reformatting these fixtures changes their MD5 and breaks the tests.
Their bytes are the test data, not source to style.

Issue: CLDSRV-1002
@bert-e

bert-e commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2

Follow integration pull requests if you would like to be notified of
build statuses by email.

The following options are set: create_pull_requests

@bert-e

bert-e commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

The following options are set: create_pull_requests

@DarkIsDude

Copy link
Copy Markdown
Contributor Author

https://docs.github.com/en/repositories/working-with-files/using-files/viewing-and-understanding-files#ignore-commits-in-the-blame-view should we try to add  .git-blame-ignore-revs to preserve the git blame, from what I can tell one with just one line in it

GitHub reads .git-blame-ignore-revs automatically; locally it needs
git config blame.ignoreRevsFile .git-blame-ignore-revs

Issue: CLDSRV-1002
@DarkIsDude
DarkIsDude marked this pull request as ready for review September 21, 2026 15:06
@DarkIsDude
DarkIsDude requested review from a team, delthas and francoisferrand September 21, 2026 15:06
console.error(
'Missing required environment variables: ' +
'AWS_GCP_BACKEND_ACCESS_KEY and AWS_GCP_BACKEND_SECRET_KEY'
'Missing required environment variables: ' + 'AWS_GCP_BACKEND_ACCESS_KEY and AWS_GCP_BACKEND_SECRET_KEY',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Missing required environment variables: ' + 'AWS_GCP_BACKEND_ACCESS_KEY and AWS_GCP_BACKEND_SECRET_KEY',
'Missing required environment variables: AWS_GCP_BACKEND_ACCESS_KEY and AWS_GCP_BACKEND_SECRET_KEY',

This needs to be fixed across codebase, if a multiple line string is reduced to 1 line, you can remove the concatenation

Comment thread bin/search_bucket.js
'otherwise only list the latest version')
.option(
'-l, --list-versions',
'List all versions of the objects that meet the search query, ' + 'otherwise only list the latest version',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'List all versions of the objects that meet the search query, ' + 'otherwise only list the latest version',
'List all versions of the objects that meet the search query, otherwise only list the latest version',

Comment on lines +29 to +30
numberRules: 'The number of CORS rules should not exceed allowed limit ' + 'of 100 rules.',
originAndMethodExist: 'Each CORSRule must identify at least one origin ' + 'and one method.',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
numberRules: 'The number of CORS rules should not exceed allowed limit ' + 'of 100 rules.',
originAndMethodExist: 'Each CORSRule must identify at least one origin ' + 'and one method.',
numberRules: 'The number of CORS rules should not exceed allowed limit of 100 rules.',
originAndMethodExist: 'Each CORSRule must identify at least one origin and one method.',

Comment on lines +242 to +244
'Invalid protocol, protocol can be http or ' +
'https. If not defined, the protocol will be selected ' +
'automatically.';

@BourgoisMickael BourgoisMickael Sep 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

strings like that could be manually edited to move the concatenation to fit in 2 lines instead of 3.

Or maybe dropping the multiple concatenations is enough to fit in 1 line.

Comment thread .git-blame-ignore-revs
Comment on lines +1 to +3
# Whole-repo Prettier reformat (CLDSRV-1002), no behaviour change.
# Run once locally: git config blame.ignoreRevsFile .git-blame-ignore-revs
02f94246fe9d3f9e4484d526adc81a73e90a0540

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the first two lines are inverted. The "run once" should be the header, then we have one comment per hash below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(For when we have future commits we want to ignore later)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants