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

Use Deno formatter instead of Prettier & reformat #49

Merged
merged 7 commits into from
Oct 15, 2021
Merged

Use Deno formatter instead of Prettier & reformat #49

merged 7 commits into from
Oct 15, 2021

Conversation

rojvv
Copy link
Member

@rojvv rojvv commented Oct 14, 2021

No description provided.

Copy link
Member

@KnorpelSenf KnorpelSenf left a comment

Choose a reason for hiding this comment

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

Could you add a config file to restore 4-space indentation, single-quotes, and no-semi?

I said we should use deno fmt for .md before I knew how horrible the formatting is. git diffing markdown changes is impossible unless we stick with one sentence per line as we've done so far.

Please revert this part of the changes.

@KnorpelSenf
Copy link
Member

I must correct myself! We could try adding config for markdown that does respects our choice of wrapping

@rojvv
Copy link
Member Author

rojvv commented Oct 14, 2021

Let's go!

Copy link
Member

@KnorpelSenf KnorpelSenf left a comment

Choose a reason for hiding this comment

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

Please adjust the CI config to use the config file.

You will also have to update the regex in the backporting script, so that imports are rewritten with double quotes again.

@EdJoPaTo
Copy link
Member

I like the idea of using deno fmt over npm tools but it had some horrible side effects like the Markdown formatting mentioned so I stopped that idea. I'm curious to see what comes out of this.
Also xo (eslint config) seems to have some helpful hints deno lint sadly don't seem to have yet. Otherwise I would like to switch as the deno variants are way less bloated and significantly faster.

@rojvv
Copy link
Member Author

rojvv commented Oct 15, 2021

@KnorpelSenf done!

@EdJoPaTo
Copy link
Member

btw: force pushs make it hard to review changes. All the changes have to be reviewed again. As "Squash and merge" exists its (at least for me) better to just add commits and squash them in the end. It wont clutter the git history that way and is easier to review.

@KnorpelSenf
Copy link
Member

It seems like there is a bug in deno fmt. It cannot handle the comma operator used in lazy sessions. It removes the surrounding brackets, hence changing runtime behaviour. Luckily, this was caught by the code not compiling anymore.

I will do some refactoring to work around the problem. Then I can also fix the CI config and change the backporting script.

Copy link
Member

@KnorpelSenf KnorpelSenf left a comment

Choose a reason for hiding this comment

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

Thanks for the contributions!

@rojserbest @EdJoPaTo could you have a look again?

@KnorpelSenf
Copy link
Member

KnorpelSenf commented Oct 15, 2021

Also confer denoland/deno#12452 regarding the bug in deno fmt that I was referring to. EDIT: A fix was released in Deno 1.15.2.

@KnorpelSenf KnorpelSenf merged commit 22e5152 into grammyjs:main Oct 15, 2021
@KnorpelSenf
Copy link
Member

@all-contributors add @rojserbest for infra

@allcontributors
Copy link
Contributor

@KnorpelSenf

I've put up a pull request to add @rojserbest! 🎉

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

3 participants