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 automated tooling to enforce coding style #1865

Open
Jermolene opened this issue Jul 6, 2015 · 5 comments
Open

Use automated tooling to enforce coding style #1865

Jermolene opened this issue Jul 6, 2015 · 5 comments

Comments

@Jermolene
Copy link
Member

There is an opportunity to use JSCS to automatically enforce our chosen coding style guidelines, as described in this blog post.

  • Build a .jscsrc file that corresponds to our existing coding standards
  • Add it to the dev dependencies of the repo
  • Add a script for checking conformance, and call it from bld/test.sh

Any help with this ticket would be much appreciated.

@pmario
Copy link
Member

pmario commented Jul 6, 2015

+1
I did install the JSCS plugin for the Brackets editor some time ago. There it works similar to the JSHint plugin. Every time you save you get some warnings that you can fix, or ignore :/

There are several plugins for different popular editors.

I also had a look at some predefined coding guidelines, but non of them fits to your actual settings. I didn't know about the auto-configure option. ... Would be worth a try.

  • We will need some special settings for our leading comments and comments in general.
  • Most of the presets prefer spaces instead of tabs, but this can be overwritten.

And if JSCS implementation is on the way, it would be nice to run all source files through JSHint too. There are a lot of warnings all over the places atm. Especially "semicolons" and "var" keyword usage, are a problem. ... But since programs could change behaviour if we don't take care fixing them, I didn't touch them.

@sukima
Copy link
Contributor

sukima commented Jul 6, 2015

Our company enforces coding standards with Hound-ci but that uses JSHint.

@Jermolene
Copy link
Member Author

@sukima and @pmario I'm embarrassed by how bad the TW5 JSHint feedback report has got. I did once keep on top of it. I'll open a ticket about it.

@pmario
Copy link
Member

pmario commented Jul 6, 2015

I think JSCS looks promising, if we find the right parameters, that fit the existing style.

hoelzro added a commit to hoelzro/TiddlyWiki5 that referenced this issue Oct 1, 2020
Addresses GH TiddlyWiki#1865

This adds eslint as a developer dependency, plus a generated eslint
config that doesn't take a very strong stance on much of anything.  The
goal here to get started using automated style checking, add eslint
checking to the testing flow, and gradually introduce stricter checks
over time.
hoelzro added a commit to hoelzro/TiddlyWiki5 that referenced this issue Oct 1, 2020
Addresses GH TiddlyWiki#1865

This adds eslint as a developer dependency, plus a generated eslint
config that doesn't take a very strong stance on much of anything.  The
goal here to get started using automated style checking, add eslint
checking to the testing flow, and gradually introduce stricter checks
over time.
Jermolene pushed a commit that referenced this issue Oct 26, 2020
* Add eslint plus very tolerant starting config

Addresses GH #1865

This adds eslint as a developer dependency, plus a generated eslint
config that doesn't take a very strong stance on much of anything.  The
goal here to get started using automated style checking, add eslint
checking to the testing flow, and gradually introduce stricter checks
over time.

* eslint: Fix ecmaVersion

See
#4421 (comment),
where @Jermolene declared TiddlyWiki targets EcmaScript 5
@pmario
Copy link
Member

pmario commented Aug 20, 2023

related to: Remove function wrapper / add matching dprint and eslint configurations #7596

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants