Skip to content

Commit

Permalink
Christian binder patch 1 (#9)
Browse files Browse the repository at this point in the history
* Create main.yml

* Update main.yml

* Update README.md

* Update main.yml

pull request is unnecessary since the latest commit will be checked

* Name Change

* Update build.gradle

Oceana had always been at war with Eastasia -George Orwell

* capital punishment is abolished

* Create TruthMin.yml

* Update README.md

* Update TruthMin.yml

* Update README.md

* Update and rename TruthMin.yml to spotless.yml

* final one this time trust

---------

Co-authored-by: Chief Technology Officer <team1710.cto@gmail.com>
Co-authored-by: Andrew-K961 <andrew.kepych@gmail.com>
Co-authored-by: Andrew <73918026+Andrew-K961@users.noreply.github.com>
  • Loading branch information
4 people authored Mar 13, 2024
1 parent 21cf6dd commit 2d92b4e
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This is a basic workflow to build robot code.

name: Build Status

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch.
on:
push:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# This grabs the WPILib docker container
container: wpilib/roborio-cross-ubuntu:2024-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Declares the repository safe and not under dubious ownership.
- name: Add repository to git safe directories
run: git config --global --add safe.directory $GITHUB_WORKSPACE

# Grant execute permission for gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# Runs a single command using the runners shell
- name: Compile and run tests on robot code
run: ./gradlew build
22 changes: 22 additions & 0 deletions .github/workflows/spotless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Spotless

on: [pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
spotless:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
# Grant execute permission for gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- run: ./gradlew spotlessCheck
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build](https://github.com/FRC-Team-1710/2024-Robot/actions/workflows/main.yml/badge.svg)](https://github.com/FRC-Team-1710/2024-Robot/actions/workflows/main.yml)
[![Spotless](https://github.com/FRC-Team-1710/2024-Robot/actions/workflows/TruthMin.yml/badge.svg)](https://github.com/FRC-Team-1710/2024-Robot/actions/workflows/TruthMin.yml)
# Team 1710 2024 Robot Code </br>
Thanks to dirtbikerxz for the [template](https://github.com/dirtbikerxz/BaseTalonFXSwerve). <br> <br>
Using PhotonVision with a Raspberry Pi 4, SDS Mk4i swerve modules, and PathPlanner autos with trajectory generation through Choreo.
31 changes: 30 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2024.3.1"
id 'com.diffplug.spotless' version '6.20.0'
}

java {
Expand Down Expand Up @@ -92,7 +93,11 @@ wpi.sim.addDriverstation()
// in order to make them all available at runtime. Also adding the manifest so WPILib
// knows where to look for our Robot Class.
jar {
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
from sourceSets.main.allSource
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
duplicatesStrategy = DuplicatesStrategy.INCLUDE
Expand All @@ -107,3 +112,27 @@ wpi.java.configureTestTasks(test)
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}

spotless {
enforceCheck = false
java {
target fileTree('.') {
include '**/*.java'
exclude '**/build/**', '**/build-*/**'
}
toggleOffOn()
palantirJavaFormat().style("AOSP")
removeUnusedImports()
trimTrailingWhitespace()
}

groovyGradle {
target fileTree('.') {
include '**/*.gradle'
exclude '**/build/**', '**/build-*/**'
}
greclipse()
indentWithSpaces(4)
trimTrailingWhitespace()
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/lib/math/FiringSolutions.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package frc.lib.math;

// format:off
public final class FiringSolutions {
private static final double shooterHeight = 0.355;
private static final double noteFallAccel = 9.8;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/lib/math/FiringSolutionsV2.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package frc.lib.math;

// format:off
public class FiringSolutionsV2 {

private static final double shooterHeight = 0.355;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/lib/math/FiringSolutionsV3.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package frc.lib.math;

// format:off
import java.util.Optional;

import edu.wpi.first.math.geometry.Translation2d;
Expand Down

0 comments on commit 2d92b4e

Please sign in to comment.