🏁
Welcome to CleanCodeWorkshop
About the Workshop
We are here with a workshop which aims at providing you an understanding of Clean Code via examples taken from various sources. This workshop will help you differentiate between "clean" and "dirty" code.
We will get our hands dirty by diving into some "dirty" code snippets and "cleaning" them with our learning. We will also see why some approaches are better than the others and try to develop a better understanding of all the principles of "Clean Code".
Takeaways from this Workshop
- Better understanding on clean coding practices.
- Choose better approach when developing.
- Ability to differentiate between different approaches.
- Fun!
Structure of the Repository
- This repository contains multiple branches named according to group numbers. Ex-
group1
,group2
etc. - All the branches contain a set of similar probelms.
- Problems are set with increasing level of complexity and difficulty.
Problem1
being the easiest.(You may wanna start here😉 )
💥
Steps to participate Fork
this repository.(Incase facing issue, follow this documentation) and clone
it.
1) group
you belong).
2) Checkout to your branch. (According to 3) Refactor the problems in the same place.
PR
[ Pull Request ] targeted to the same branch.
4) Create a 5) You have successfully participated.
6) Sit back and relax.
Methods of Participation
Web UI
Participation via
Github CLI
: For Windows
Participation via - Click here to download the
gh cli
tool. - After installing open powershell.
gh auth login
Github CLI
: For MacOS
Participation via brew install gh
gh auth login
GitHub CLI
: For Linux
Participation via For all the nerds who want to learn and explore more of GitHub CLI
please follow along. If you have already installed gh cli
you can skip to the second section.
Installing gh cli
link
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
gh auth login
Installation of gh command line in linux
After successful installation of gh cli
, it is now time to start the task at hand.
# Clone the repo
git clone https://github.com/Imsurajkr/cleancodeworkshop.git
# Navigate into the root of the repo.
cd cleancodeworkshop
# Fork the repo.
gh repo fork
parentBranch={GroupName} # Replace {GroupName} with your group
candidateName={MemberName} # Replace {MemberName} with your name (no spaces recommended)
branchName="$parentBranch-$candidateName"
git checkout -b $branchName
# All set! add your magic...
# When done
git pull
git add <FilesChanged>
git commit -m "Customized Message"
git push
# Raise PR
gh pr create --title "I did some changes" --body "And it works" --base <branchName> # The branch into which you want your code merged
# All the best :-)
Sample video demonstration on how to fork
, branch
, add, commit, push, and generating PR
Screenshot of PR creation