Team2068 / Muhkeighnzeigh

2023 Charged Up Code
Other
0 stars 0 forks source link

2023 Charged Up

This is The Metal Jackets robot code for the 2023 FIRST Robotics Competition, Charged Up.

Docs / Resources

Coding Style

Until we define our own coding style, we'll use Google's and record any deviations here.

VSCode and the WPILib Dev Environment

Follow the WPILib Installation Guide to set up your environment.

Extensions

You'll need the following extensions:

Mandatory

Optional

Setting up the JDK

You should've already set the location of your JDK installation in the above tutorial. If you need to set it again, here are the instructions.

  1. Navigate to File -> Preferences -> Settings
  2. Search for "jdk" in the search bar
  3. Click Java Configuration on the left-hand sidebar. The only setting visible should be Java: Home
  4. Click on Edit in settings.json
  5. The right-hand side stores any settings made by the user. Add a line like this at the end of the file: "java.home": "/Path/To/JDK/Installation"
    • If you don't know where your JDK installation is, it's probably in C:\Users\<Your Username>\frc2020\jdk.
  6. You're done! Wait a bit for the Java Language Server to start up and recognize your project (you should see a little spinning icon at the bottom left of your screen), then test it out by clicking on a variable type (like Module or Drive or Double) and pressing F12. If all goes well, you should be taken to the definition of that class.

Opening Projects

It's pretty easy. File -> Open Folder..., then navigate to the repository you have cloned (The folder named Muhkeignzeigh this year).

Want to learn more?

Code Navigation

Basic Editing

Building and Deploying

Contributing

Here's how to get your code into the main robot repository:

If you've just joined the team:

  1. Make an account on GitHub.
  2. Ask one of the robot programming leads to add your account to the Team2068 robot programming team.

If it's the first time you've contributed to this repo:

Any time you want to make a change:

We use a feature branch workflow. You can read more about that here.

  1. Create and checkout a new branch.
    • git checkout -b <your_branch_name>, where is a descriptive name for your branch. For example fix-shooter-wheel. Use dashes in the branch name, not underscores.
  2. Make whatever code changes you want/need/ to make. Be sure to write tests for your changes!
  3. Commit your work locally.
    • If you're on a shared laptop set the author of the commit message by: git commit --author="Author Name <email@address.com>"
    • Try to make your commits small, like example. For example, moving functions around should be different from adding features, and changes to one subsystem should be in a different commit than changes to another subsystem.
    • Just give a short summary. or follow these for conventions.
    • If your change is anything more than a few lines or small fixes, don't skip the extended description. If you are always using git commit with the -m option, stop doing that.
  4. Push to your branch.
    • git push origin <your_branch_name>.
  5. Submit a pull request.
    1. Select the branch that you just pushed from the "Branch" dropdown menu.
    2. Click "New Pull Request".
    3. Review the changes that you made.
    4. Explain what and why you did the things you're trying to commit. Make the reviewer's life easier.
    5. If you are happy with your changes, click "Create Pull Request".
  6. Wait
    • People must review (and approve of) your changes before they are merged - master is locked to any pull requests that don't have at least 2 reviews.
    • If there are any concerns about your pull request, fix them; just do it bro; To update your PR, just push to the branch you made before.
    • Don't dismiss someone's review when you make changes - instead, ask them to re-review it.
  7. Merge your changes into master
    • If there are no conflicts, push the "merge" button.
    • If there are conflicts, fix them locally on your branch, push them, wait for Travis CI to pass, and then merge.

Code Review

Code reviews are one of the hardest things to get right. There's a lot of discussion about this online, and those before us said ddg i-