Skip to content

Conversation

@bbrks
Copy link
Member

@bbrks bbrks commented Oct 2, 2025

EditorConfig covers basic rules for most files/languages. Most editors will automatically utilize .editorconfig to provide committed project-level rules for formatting without individual/manual configuration.

Introduced to cover consistent formatting for things like JSON and XML files, without introducing more language specific tools.
More advanced language dependent formatting can still use things like gofmt, yamllint, ruff, etc.

Prettier is one way to use those EditorConfig rules, which can validate and/or automatically fix. Most editors will reformat on save without a third-party tool though.

Changes of note:

  • db/functions/js_runner changes to allow the invalid javascript .js file to be ignored
  • com.couchbase.mobile.sync_gateway.plist to make the file valid XML (verified with plutil)
  • package.json - is a convenient way to specify a list of non-critical dev tools: Prettier and redocly-cli, which can be installed simply via npm install or yarn install

Actual formatting fixes off the back of these rules can be made in a follow-up PR just for isolating them.

I've added a preview below either way - it is mostly indentation changes.

diff after prettier --write .:

 155 files changed, 28517 insertions(+), 13810 deletions(-)
 .github/ISSUE_TEMPLATE.md                          |     7 +
 .github/PULL_REQUEST_TEMPLATE.md                   |     4 +
 .github/copilot-instructions.md                    |     2 +-
 .github/dependabot.yml                             |     6 +-
 .github/workflows/service.yml                      |     4 +-
 .golangci-strict.yml                               |    10 +-
 .golangci.yml                                      |     2 +-
 .redocly.yaml                                      |    34 +-
 .yamllint.yml                                      |     1 -
 CONTRIBUTING.md                                    |    17 +-
 README.md                                          |    16 +-
 build/windows/wix_installer/Config.wxi             |     3 +-
 docs/BUILD.md                                      |    39 +-
 docs/BUILD_EXTRA.md                                |     9 +-
 docs/api/components/parameters.yaml                |     2 +-
 docs/api/components/schemas.yaml                   |   261 +-
 docs/api/paths/admin/_all_dbs.yaml                 |     4 +-
 docs/api/paths/admin/_post_upgrade.yaml            |     6 +-
 docs/api/paths/admin/keyspace-_raw-docid.yaml      |    65 +-
 docs/api/paths/common/_ping.yaml                   |     2 +-
 .../diagnostic/keyspace-docid-_all_channels.yaml   |     2 +-
 .../paths/diagnostic/keyspace-import_filter.yaml   |     1 -
 docs/api/paths/public/db-_session.yaml             |     4 +-
 docs/api/paths/public/keyspace-_bulk_docs.yaml     |     2 +-
 docs/api/plugins/decorators/excise-rbac-capella.js |     2 +-
 .../decorators/replace-description-capella.js      |     8 +-
 docs/api/plugins/plugin.js                         |    14 +-
 docs/api/plugins/rules.js                          |    14 +-
 .../rules/check-additional-properties-names.js     |     2 +-
 docs/api/plugins/rules/check-properties-sorted.js  |    16 +-
 docs/api/plugins/rules/typecheck-defaults.js       |    42 +-
 docs/design/cache/README.md                        |     6 +-
 docs/design/cache/cache_overview.md                |   111 +-
 docs/design/cache/front_end_cache_writes.md        |    24 +-
 docs/design/cache/multi-writer.md                  |    33 +-
 docs/design/cache/single_writer.md                 |   105 +-
 docs/design/cache/timestamp_sequence.md            |    29 +-
 docs/design/channel_index/clock_handling.md        |    15 +-
 docs/design/channel_index/feed_management.md       |     9 +-
 docs/design/channel_index/index_reads.md           |     2 +-
 docs/design/channel_index/index_storage.md         |    92 +-
 docs/design/channel_index/index_writes.md          |    36 +-
 docs/design/channel_index/overview.md              |   100 +-
 docs/design/channel_index/sequence_handling.md     |    30 +-
 examples/README.md                                 |    80 +-
 .../collections-with-custom-scope.json             |    10 +-
 .../collections-with-default-collection.json       |    10 +-
 examples/database_config/ee-basic-delta-sync.json  |     2 +-
 examples/database_config/ee-cache-config.json      |     2 +-
 examples/database_config/events-webhook.json       |     5 +-
 examples/database_config/import-filter.json        |     5 +-
 examples/database_config/openid-connect.json       |     2 +-
 examples/database_config/sync-function.json        |     5 +-
 examples/grafana/README.md                         |     5 +-
 examples/grafana/dashboard.json                    | 14310 +++++++++----------
 examples/legacy_config/basic-sync-function.json    |     7 +-
 .../legacy_config/config-shared-bucket-filter.json |     6 +-
 examples/legacy_config/config-shared-bucket.json   |     2 +-
 examples/legacy_config/cors.json                   |     6 +-
 examples/legacy_config/democlusterconfig.json      |    51 +-
 examples/legacy_config/ee-cache-config.json        |    38 +-
 examples/legacy_config/logging-with-redaction.json |     2 +-
 examples/legacy_config/logging-with-rotation.json  |     2 +-
 examples/legacy_config/openid-connect.json         |    54 +-
 examples/legacy_config/replications-in-config.json |     4 +-
 examples/prometheus/README.md                      |    11 +-
 examples/ssl/README.md                             |     6 +-
 examples/ssl/ssl.json                              |     2 +-
 examples/startup_config/basic.json                 |     2 +-
 examples/startup_config/cors.json                  |     2 +-
 examples/startup_config/logging-with-rotation.json |     2 +-
 .../startup_config/logging-without-redaction.json  |     2 +-
 examples/startup_config/x509.json                  |     2 +-
 integration-test/docker-compose.yml                |    10 +-
 manifest/1.3.1.xml                                 |   376 +-
 manifest/1.4.0.xml                                 |   267 +-
 manifest/1.4.1.xml                                 |   267 +-
 manifest/1.5.0.xml                                 |   441 +-
 manifest/1.5.1.xml                                 |   441 +-
 manifest/1.5.2.xml                                 |   441 +-
 manifest/2.0.0.xml                                 |   463 +-
 manifest/2.1.0.xml                                 |   484 +-
 manifest/2.1.1.xml                                 |   484 +-
 manifest/2.1.xml                                   |   484 +-
 manifest/2.1/2.1.2.1.xml                           |   484 +-
 manifest/2.1/2.1.2.xml                             |   488 +-
 manifest/2.1/2.1.3.xml                             |   484 +-
 manifest/2.5.xml                                   |   506 +-
 manifest/2.5/2.5.0.xml                             |   506 +-
 manifest/2.5/2.5.1.xml                             |   506 +-
 manifest/2.6.xml                                   |   501 +-
 manifest/2.6/2.6.0.xml                             |   501 +-
 manifest/2.6/2.6.1.xml                             |   501 +-
 manifest/2.7.xml                                   |   503 +-
 manifest/2.7/2.7.0.xml                             |   503 +-
 manifest/2.7/2.7.1.xml                             |   503 +-
 manifest/2.7/2.7.2.xml                             |   503 +-
 manifest/2.7/2.7.3.xml                             |   503 +-
 manifest/2.8.xml                                   |   610 +-
 manifest/2.8/2.8.0.1.xml                           |   601 +-
 manifest/2.8/2.8.0.xml                             |   601 +-
 manifest/2.8/2.8.1.xml                             |   601 +-
 manifest/2.8/2.8.2.xml                             |   601 +-
 manifest/2.8/2.8.3.1.xml                           |   594 +-
 manifest/2.8/2.8.3.2.xml                           |   594 +-
 manifest/2.8/2.8.3.3.xml                           |   594 +-
 manifest/2.8/2.8.3.4.xml                           |   594 +-
 manifest/2.8/2.8.3.xml                             |   601 +-
 manifest/3.0.xml                                   |   611 +-
 manifest/3.0/3.0.0.xml                             |   595 +-
 manifest/3.0/3.0.1.xml                             |   595 +-
 manifest/3.0/3.0.2.xml                             |   595 +-
 manifest/3.0/3.0.3.xml                             |   595 +-
 manifest/3.0/3.0.4.1.xml                           |   595 +-
 manifest/3.0/3.0.4.xml                             |   595 +-
 manifest/3.0/3.0.5.xml                             |   611 +-
 manifest/3.0/3.0.6.xml                             |   611 +-
 manifest/3.0/3.0.7.xml                             |   611 +-
 manifest/3.0/3.0.8.1.xml                           |   611 +-
 manifest/3.0/3.0.8.2.xml                           |   611 +-
 manifest/3.0/3.0.8.xml                             |   611 +-
 manifest/3.1.xml                                   |    30 +-
 manifest/3.1/3.1.0.xml                             |    30 +-
 manifest/3.1/3.1.1.1.xml                           |    30 +-
 manifest/3.1/3.1.1.xml                             |    30 +-
 manifest/3.1/3.1.10.1.xml                          |    34 +-
 manifest/3.1/3.1.10.xml                            |    30 +-
 manifest/3.1/3.1.11.1.xml                          |    30 +-
 manifest/3.1/3.1.11.xml                            |    30 +-
 manifest/3.1/3.1.2.xml                             |    30 +-
 manifest/3.1/3.1.3.1.xml                           |    30 +-
 manifest/3.1/3.1.3.xml                             |    30 +-
 manifest/3.1/3.1.4.xml                             |    30 +-
 manifest/3.1/3.1.5.xml                             |    30 +-
 manifest/3.1/3.1.6.xml                             |    30 +-
 manifest/3.1/3.1.7.xml                             |    30 +-
 manifest/3.1/3.1.8.xml                             |    30 +-
 manifest/3.1/3.1.9.xml                             |    30 +-
 manifest/3.2.xml                                   |    30 +-
 manifest/3.2/3.2.0.xml                             |    30 +-
 manifest/3.2/3.2.1.xml                             |    30 +-
 manifest/3.2/3.2.2.1.xml                           |    30 +-
 manifest/3.2/3.2.2.xml                             |    30 +-
 manifest/3.2/3.2.3.xml                             |    30 +-
 manifest/3.2/3.2.4.1.xml                           |    34 +-
 manifest/3.2/3.2.4.xml                             |    30 +-
 manifest/3.2/3.2.5.1.xml                           |    34 +-
 manifest/3.2/3.2.5.xml                             |    34 +-
 manifest/3.3.xml                                   |    30 +-
 manifest/4.0.xml                                   |    30 +-
 manifest/default.xml                               |    30 +-
 manifest/dev.xml                                   |   436 +-
 ruleguard/README.md                                |     2 +-
 service/README.md                                  |     2 -
 sync_gateway.sublime-project                       |   153 +-
 155 files changed, 28517 insertions(+), 13810 deletions(-)

@bbrks bbrks requested a review from torcolvin October 2, 2025 17:31
Copilot AI review requested due to automatic review settings October 2, 2025 17:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces EditorConfig and Prettier for standardized formatting across the project. The changes establish global formatting rules that work across different file types and editors without requiring individual configuration.

Key changes:

  • Added EditorConfig configuration for consistent basic formatting rules (line endings, indentation, etc.)
  • Introduced Prettier with XML plugin for automated formatting and validation
  • Fixed XML syntax issues in plist file to make it valid XML

Reviewed Changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.editorconfig Defines global formatting rules for all file types with special indentation for manifest files
.prettierrc Configures Prettier with trailing commas, single quotes, and XML plugin
.prettierignore Excludes problematic files from Prettier formatting (WXS files, template JS files, Go modules)
package.json Adds development dependencies for Prettier and Redocly CLI tools
service/script_templates/com.couchbase.mobile.sync_gateway.plist Fixes XML syntax by adding proper quotes around attribute values
db/functions/js_runner.go Renames embedded JS file and updates variable names to exclude it from Prettier

@bbrks
Copy link
Member Author

bbrks commented Oct 2, 2025

will simplify what I'm doing and just merge into #7787

@bbrks bbrks closed this Oct 2, 2025
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.

3 participants