Skip to content

Add verbose and commit-header functionality #46

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

Merged
merged 4 commits into from
Sep 15, 2023
Merged

Add verbose and commit-header functionality #46

merged 4 commits into from
Sep 15, 2023

Conversation

ravibrock
Copy link
Contributor

@ravibrock ravibrock commented Aug 10, 2023

Verbose

Added an option to display additional information about submissions in commit logs and folder names.

Commit header

The prefix for automated commits is now changeable. I made some other changes to commit formatting that serve to reduce redundancy and provide more novel information about each commit while still keeping the automated messages reasonably concise.

Folders

I also made it optional to always put problems into their own repo (so that each submission folder can be in the repo's base directory if desired, while still potentially segregating submissions into per-user repos for collaboration).

Miscellaneous

There are also some small tweaks like adding newlines at the end of submission files - recommended for git, but not added automatically by Leetcode. Some diffs are also caused by my Vim config stripping spaces from the end of lines or adding newlines at the bottoms of code files.

Other

The README yaml example might need updating with a new tag if this is merged. Not sure but didn't want to add a new release/tag myself.

Images:

The screenshot below was generated by this yaml (linked to my fork for testing):

name: Sync Leetcode

on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Sync
        uses: ravibrock/leetcode-sync@v1.6
        with:
          github-token: ${{ github.token }}
          leetcode-csrf-token: ${{ secrets.CSRFTOKEN }}
          leetcode-session: ${{ secrets.LEETCODE_SESSION }}
          verbose: true
          commit-header: '[LC Sync]'

Screenshot 2023-08-10 at 18 07 31

And the last screenshot by this one:

name: Sync Leetcode

on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Sync
        uses: ravibrock/leetcode-sync@v1.6
        with:
          github-token: ${{ github.token }}
          leetcode-csrf-token: ${{ secrets.CSRFTOKEN }}
          leetcode-session: ${{ secrets.LEETCODE_SESSION }}
          destination-folder: 'problems'
          verbose: false
          commit-header: '[LC Sync]'

Screenshot 2023-08-10 at 18 43 35

Copy link
Owner

@joshcai joshcai left a comment

Choose a reason for hiding this comment

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

Thank you for the great contributions! Looks good overall except for some minor nits.

@ravibrock
Copy link
Contributor Author

ravibrock commented Aug 18, 2023

Should be done now, thank you!

  • Resolved merge conflicts with @jaspinderkohli's PR
    • Changed question.md file name to README.md so Github will display it automatically
    • Changed question_data variable name to questionData to conform to camel case found elsewhere
  • Addressed all the comments you added here

@joshcai joshcai merged commit 5e55354 into joshcai:master Sep 15, 2023
@joshcai
Copy link
Owner

joshcai commented Sep 15, 2023

Thank you!

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.

2 participants