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

feat: add -v flag to display version #1063

Merged
merged 3 commits into from
Dec 1, 2023
Merged

feat: add -v flag to display version #1063

merged 3 commits into from
Dec 1, 2023

Conversation

xl4624
Copy link
Contributor

@xl4624 xl4624 commented Nov 30, 2023

PR Checklist

Overview

I was browsing the list of issues labeled good first issue and saw that issue #704 had its attached PR closed. The version feature has basically already been implemented, but this just adds the flag to display the version.

🧢

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (21c8529) 94.17% compared to head (3c59c29) 94.18%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1063   +/-   ##
=======================================
  Coverage   94.17%   94.18%           
=======================================
  Files          96       96           
  Lines        5564     5571    +7     
  Branches      446      448    +2     
=======================================
+ Hits         5240     5247    +7     
  Misses        323      323           
  Partials        1        1           
Flag Coverage Δ
create 70.63% <50.00%> (-0.04%) ⬇️
initialize 41.83% <50.00%> (+<0.01%) ⬆️
migrate 69.80% <50.00%> (-0.04%) ⬇️
unit 72.06% <90.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looks like you're making good progress - and thanks for adding a test too! 🙌

Let me know if you need any help fixing up the last bits of complaints. https://github.com/JoshuaKGoldberg/create-typescript-app/blob/386bd14573d1ea1230e9adbe8436e935d7077c27/.github/DEVELOPMENT.md#development describes the things that are failing so far, and has a link at the top to a blog post too.

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Nov 30, 2023
@xl4624 xl4624 closed this Nov 30, 2023
@xl4624 xl4624 reopened this Nov 30, 2023
@xl4624
Copy link
Contributor Author

xl4624 commented Nov 30, 2023

I think I fixed it? The issue was that my PR wasn't updated to the changes from the upstream repository, right? I kind of messed up and had to git push --force

From the blog:

git checkout main
git pull upstream main
git push

Once I do this step to update my local/origin main, do I need to git checkout feature-branch and then git merge main to apply these changes to my feature branch?

@github-actions github-actions bot removed the status: waiting for author Needs an action taken by the original poster label Nov 30, 2023
@JoshuaKGoldberg
Copy link
Owner

Once I do this step to update my local/origin main, do I need to git checkout feature-branch and then git merge main to apply these changes to my feature branch?

Yup, exactly! Now that your main is in sync with the upstream's, those are the two commands that will merge in the commits from main to your feature branch.

Though, I think the lint errors are legit and not from some history weirdness. From the linked ❌ lint report:

/home/runner/work/create-typescript-app/create-typescript-app/src/bin/index.test.ts
Error:   6:1  error  Expected "./index.js" to come before "./packageJson.js"  perfectionist/sort-imports

The ESLint extension for your editor should be able to auto-fix that. Alternately, pnpm run lint --fix should do it for you.

@xl4624
Copy link
Contributor Author

xl4624 commented Dec 1, 2023

Ah I see 👀. I missed that when I was looking back at this PR, I just saw @codecov's report and thought it was just that my PR was not updated. Just ran pnpm run lint --fix

Although now that I'm looking at the pre-commit script, how come npx lint-staged doesn't run that automatically for any committed files?

@JoshuaKGoldberg
Copy link
Owner

Great question! There are two kinds of tools folks often run as precommit hooks:

  • Formatters (e.g. Prettier): quickly reformat code to a standard preference
  • Linters (e.g. ESLint): run a set of logical rules of various complexity levels

This repo template only runs Prettier as a commit hook. It doesn't run ESLint because:

  • Some of the enabled lint rules use type information, which makes them slow. Slow commit hooks are annoying.
  • Lint rules that use type info can introduce complaints in files that aren't touched by Git, so the commit hook might not catch everything anyway.

Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

💯, perfect - thanks for this!

@JoshuaKGoldberg JoshuaKGoldberg merged commit a29fc6a into JoshuaKGoldberg:main Dec 1, 2023
16 checks passed
@JoshuaKGoldberg
Copy link
Owner

@all-contributors please add @xl4624 for code.

🤖 Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! 💙

Copy link
Contributor

@JoshuaKGoldberg

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

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

Copy link

github-actions bot commented Dec 1, 2023

🎉 This is included in version v1.49.0 🎉

The release is available on:

Cheers! 📦🚀

JoshuaKGoldberg pushed a commit that referenced this pull request Dec 1, 2023
Adds @xl4624 as a contributor for code.

This was requested by JoshuaKGoldberg [in this
comment](#1063 (comment))

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
@xl4624 xl4624 deleted the v-flag branch December 2, 2023 00:37
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.

🚀 Feature: Add a --version CLI option
2 participants