-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
build: add workflow preferring TypeScript files #9901
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9901 +/- ##
==========================================
+ Coverage 71.22% 71.67% +0.44%
==========================================
Files 585 585
Lines 30828 32789 +1961
Branches 3237 3237
==========================================
+ Hits 21957 23501 +1544
- Misses 8762 9179 +417
Partials 109 109
Continue to review full report at Codecov.
|
It looks like your PR contains new |
This is a great idea! |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
msg: "It looks like your PR contains new `.js` or `.jsx` files. As decided in [SIP-36](https://github.com/apache/incubator-superset/issues/9101), all new files should be written in TypeScript. Please convert new JavaScript files to TypeScript and then re-request review." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about a title to make this more visible
with:
msg: |
## WARNING: TypeScript Preferred
It looks like your PR contains new `.js` or `.jsx` files. As decided in [SIP-36](https://github.com/apache/incubator-superset/issues/9101), all new files should be written in TypeScript. Please convert new JavaScript files to TypeScript (`.ts` or `tsx`) then re-request review.
WARNING: Prefer TypeScript
It looks like your PR contains new .js
or .jsx
files. As decided in SIP-36, all new files should be written in TypeScript. Please convert new JavaScript files to TypeScript then re-request review.
It'd also be nice if the comment could be deleted when new js
was removed from PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea, I'll add a title.
I couldn't find a github action for deleting comments unfortunately, so I don't think there's an easy way to implement your second comment...
ping @ktmud for rereview |
* Add workflow preventing non TypeScript Files * Create comment_preferring_typescript.md * Update prevent_non_typescript_files.yml * Update prevent_non_typescript_files.yml * Update prevent_non_typescript_files.yml * Delete comment_preferring_typescript.md * Create comment_preferring_typescript.md * Delete comment_preferring_typescript.md * Update prevent_non_typescript_files.yml * Update prevent_non_typescript_files.yml * Update prevent_non_typescript_files.yml * Update prevent_non_typescript_files.yml * Update prevent_non_typescript_files.yml * Update prevent_non_typescript_files.yml * Update prevent_non_typescript_files.yml * Update prevent_non_typescript_files.yml * Create test.js * Delete test.js * Update prevent_non_typescript_files.yml * Rename prevent_non_typescript_files.yml to prefer_typescript.yml * Update prefer_typescript.yml
SUMMARY
Adds a Github workflow to check if any
.js
or.jsx
files were added in a PR, and adds a comment to the PR asking to change the files to use TypeScript. This check always passes and will never prevent merge.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Comments when a
.js
file is added:Skips the comment step when no js files are added:
TEST PLAN
Add a
.js
file to this PR and see the message appear. See the comment step skip when no js is added. Also test thejq
command locally to ensure it works will all file extensionsADDITIONAL INFORMATION
to: @ktmud @john-bodley @kristw @nytai @graceguo-supercat