Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tools/ dir and some handy utilities #702

Merged
merged 15 commits into from
Jun 8, 2024

Conversation

inexorabletash
Copy link
Member

@inexorabletash inexorabletash commented Jun 5, 2024

The tools are intended for spec editors to use when authoring and/or reviewing changes. They aren't incorporated into the spec publishing process, but that could be considered in the future.

  • tools/reformat-js.py - reformats JS blocks in the spec (per a top-level .clang-format)
  • tools/lint.mjs - looks for convention violations and other glitches

The reformat-js.py tool has been applied to index.bs


Preview | Diff

The tools are intended for spec editors to use when authoring and/or
reviewing changes. They aren't incorporated into the spec publishing
process, but that could be considered in the future.

- tools/reformat_js - reformats JS blocks in the spec
- tools/lint.mjs - looks for convention violations and other glitches

The reformat_js tools has been applied to index.bs
@inexorabletash
Copy link
Member Author

As long promised, here are some tools I've written to help with authoring the spec. They're inconsistent and best effort, but I've found them useful. I think they're too immature to incorporate into the Makefile (does anyone use that?) or the spec publishing action, but iteration is welcome!

Copy link
Member

@anssiko anssiko left a comment

Choose a reason for hiding this comment

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

Thanks a lot for these contributions!

I already test drove the lint tool and found it very helpful 👍

@inexorabletash
Copy link
Member Author

Also FYI I kicked off a thread with spec-prod https://lists.w3.org/Archives/Public/spec-prod/2024AprJun/0003.html - but let's start locally.

Copy link
Collaborator

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

Thanks JB. 2 opinionated style thoughts, plus easy ones.

tools/lint.mjs Outdated Show resolved Hide resolved
tools/lint.mjs Show resolved Hide resolved
tools/lint.mjs Show resolved Hide resolved
tools/lint.mjs Outdated Show resolved Hide resolved
tools/lint.mjs Show resolved Hide resolved
tools/reformat_js Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

These tools would be very useful! Thanks much @inexorabletash !

tools/reformat_js Outdated Show resolved Hide resolved
tools/lint.mjs Show resolved Hide resolved
tools/README.md Outdated Show resolved Hide resolved
tools/lint.mjs Outdated Show resolved Hide resolved
Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

Another nit: you may want to add npm related files into .gitignore:
/tools/node_modules/
/tools/package-lock.json

tools/README.md Show resolved Hide resolved
@inexorabletash
Copy link
Member Author

Another nit: you may want to add npm related files into .gitignore: /tools/node_modules/ /tools/package-lock.json

Done in 1a1e054

Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

LGTM! And verified in my dev environment. Thanks much!

Copy link
Collaborator

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

😎 Cool. Thanks JB.

tools/lint.mjs Outdated Show resolved Hide resolved
@fdwr fdwr merged commit 74b9831 into webmachinelearning:main Jun 8, 2024
2 checks passed
github-actions bot added a commit that referenced this pull request Jun 8, 2024
SHA: 74b9831
Reason: push, by fdwr

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@inexorabletash inexorabletash deleted the tools branch June 8, 2024 05:51
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.

None yet

4 participants