-
Notifications
You must be signed in to change notification settings - Fork 2
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
Task automation with ssb-scripts #17
Comments
I think this could be good, while I still see how it could be done differently (e.g. by defaulting to popular code styles such as default Prettier). If this is created, though, I recommend it being called |
@staltz this won't necessarily modify the tool defaults but, for example, offers functionality to run the scripts as a git hook to format the code before committing or CI validations. |
Good idea! Have you seen this? https://github.com/christianbundy/common-good (It's the 'reasonable default' module for Oasis, which I've very much enjoyed using.) I think the biggest hurdle: how do we want to deal with code style PRs? I've been hesitant to open one because I don't want to have The Big Code Style Argument, but I'd really like to have some consistent code style in each project. I'd be happier if we had consistent code style in all of the projects, but I'm not sure how popular that idea would be. Btw, I was recently converted from Standard to Prettier after noticing:
|
I think the steps for this would be:
|
@christianbundy the formatting can be done with Prettier in a pre-commit hook, nor the developer or maintainer have to worry about this. ESLint can be used to prevent code with styling errors to be pushed or merged using pre-commit hooks and GitHub actions. All of these processes can be automated. |
Yep! I think we agree, I've used both ESLint and Prettier in a pre-commit hook (managed via Husky). Did you see the first comment I published? I'm very interested in having a tool like this, I just want to make sure that we're discussing the problem with maintainers before building/deploying a solution. This is probably useful context for why I'm hesitant to touch anything: ssbc/ssb-server#591 |
I agree on using either Standard or Prettier, I don't care much which one, but I fully agree we should have something that applies automatically.
Can also be quite non-controversial to apply Standard: ssbc/secret-stack#53 |
I don't have any opinions about the specific linters and what not. But I want to add that by doing this, we are avoiding the ssb-server situation up front so I'm much in favor of figuring out something and using that. |
ssb-scripts
Create a JavaScript application or series of scripts bundled in a package that allows us to perform and automate common tasks across all the SSB applications.
Rationale
Keeping a consistent code style, linting rules, and toolchain selection is a challenging goal to achieve, and, in most cases, you could say impossible.
Having an independent package controlling all these elements will allow us to perform all these operations without adding extra work on the package developers and maintainers.
Rules and automation
The following is a list of the tools I consider we can use in all the SSB packages to keep a consistent feel in the code style and automate tasks like CI testing.
We can add more if we consider it necessary.
How
ssb-scripts will add/replace some of the host’s
package.log
scripts, allowing the developer to run the tools directly from the host package.Inspiration
We can use a similar approach to the one used in React Scripts.
ToDo
The text was updated successfully, but these errors were encountered: