igordejanovic / parglare

A pure Python LR/GLR parser - http://www.igordejanovic.net/parglare/
MIT License
136 stars 32 forks source link

Some spelling and formatting fixes. #109

Closed ghost closed 4 years ago

ghost commented 4 years ago

I also reverted my previous commit.

igordejanovic commented 4 years ago

@MohamedAlFahim Thanks.

Please clean up this branch by squashing all commits (see git interactive rebase how it can be done). This PR should have only a single commit with these typo/style fixes. Also please take care of failing style check.

ghost commented 4 years ago

I am currently trying to squash the 3 commits in PyCharm, but am having troubles doing so. In the Git Log view, Interactively Rebase from Here... is disabled for the commit Revert .version import removal. Some formatting and spelling fixes. as The commit is already pushed to protected branch 'origin/master'. For the commit Merge branch 'master' of https://github.com/igordejanovic/parglare, the reason is Selected commit has 2 parents, and for the commit Remove "from .version import __version__" in __init__.py as it was causing "ModuleNotFoundError: No module named 'parglare.version'", the reason is The commit is already pushed to protected branch 'origin/master'.

igordejanovic commented 4 years ago

I don't use PyCharm so can only guess from the messages you get. It seems that master branch of your fork is protected. You can check in the settings of your repository on GitHub. Either that or PyCharm considers master branch as protected by default (check the config in PyCharm). The other error says that you have a merge commit in the region you are trying to do interactive rebase. In this case the strategy is different.

Anyway, when working on a new feature/contribution it is recommended to create a new branch and submit that as a PR. You can check out parglare contribution guide.

If you want I can do cleanup on my side.

ghost commented 4 years ago

I think that doing the following should solve the problem:

  1. I will close this pull request.
  2. I will delete my GitHub fork and local copy.
  3. I will re-fork and re-clone Parglare.
  4. I will create a branch called "patches".
  5. I will redo the spelling and formatting fixes on that branch, and fix the code style.
  6. I will make a pull request to merge the "patches" branch of my fork to the "master" branch of the main Parglare repository.
igordejanovic commented 4 years ago

@MohamedAlFahim Yes, that will do, but it would be much faster if you do (I'm writing this from the top of my head, not tested):

1) Create a new branch in your repo that starts at the tip of this fork master branch.

git checkout -b formatting-fixes <the hash of this master tip>

2) Cherry pick just the commit with formatting fixes.

git cherry-pick <the hash of formatting fixes commit>

3) Checkout master and hard reset to this new branch.

git checkout master
git reset --hard formatting-fixes

4) Now your master contains only formatting fixes on top of this fork master. So just push (force) and that will update this PR.

git push --force

Check before force push that what you have on your local master branch is actually what you want.

ghost commented 4 years ago

@igordejanovic Sorry for the late reply. I have been busy recently. To be safe, I will go with my original solution.

ghost commented 4 years ago

@igordejanovic I will do steps 3 to 6 once I am less busy.