Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Create jsonschema for configuration file#747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
zidhuss wants to merge1 commit intoswiftlang:main
base:main
Choose a base branch
Loading
fromzidhuss:config-schema

Conversation

@zidhuss
Copy link

This PR adds a JSON Schema that describes the.swift-format configuration file.

When this schema is referenced, It serves as a form of documentation and provides auto-completion and validation for configuration options (in editors that support it).

SCR-20240601-rhbx

Ideally you'd want to generate this from the code as done in#615. However the documentation for the other configuration options isn't automated from the comments leading to out of date documentation (#455).

My aim is to get this schema in theschema store so that editors automatically associate.swift-format files with it.

MahdiBM and yaroslavyaroslav reacted with thumbs up emoji
Copy link
Member

@ahoppenahoppen left a comment

Choose a reason for hiding this comment

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

Sorry for the late review@zidhuss. Adding a reference for the.swift-format file is great!

I assume you wrote the schema by hand, right? I think it would be great if we had a script to make sure it’s in sync with Configuration.md. Maybe we could even generate Configuraiton.md based on the JSON schema. Could you be interested in writing such as script (ideally in Swift but really any scripting language would be fine)?

@allevato
Copy link
Member

It would be great to generate this from the doc comments in theConfiguration struct (and the other structs that it contains) like you mentioned was done for rules in#615, and also generate the Markdown from that (or alternatively, just abandon Configuration.md in favor of DocC comments). Otherwise, if we just check in a hand-written version of this file, it will go stale the same way the Markdown has.

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

Reviewers

@ahoppenahoppenahoppen left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@zidhuss@allevato@ahoppen

[8]ページ先頭

©2009-2025 Movatter.jp