Skip to content
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

Update pre-commit hooks to latest versions #1103

Merged
merged 28 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d5d08d9
Update pre-commit hooks to latest versions
pre-commit-ci[bot] Mar 6, 2023
7997847
Run apt-get update before upgrade (#1001)
kawaiiPlat Mar 9, 2023
0ddebfc
Remove clang-format upgrade because of lack of aarch64 wheels for Linux
cbrxyz Mar 9, 2023
b48e3e2
Merge branch 'pre-commit-ci-update-config' of https://github.com/uf-m…
cbrxyz Mar 9, 2023
e317879
Update pre-commit hooks to latest versions
pre-commit-ci[bot] Apr 3, 2023
7135e79
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 3, 2023
1997acc
Merge master
cbrxyz Apr 3, 2023
7791f49
Fix spelling mistakes for codespell
cbrxyz Apr 8, 2023
141e457
Update pre-commit hooks to latest versions
pre-commit-ci[bot] May 1, 2023
547fecc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 1, 2023
078ee8a
Update pre-commit dependencies to latest versions
cbrxyz May 12, 2023
3728f5c
Update files to match new pre-commit updates
cbrxyz Jun 1, 2023
bb6d831
Update pre-commit hooks to latest versions
pre-commit-ci[bot] Aug 7, 2023
1304cda
Merge master
cbrxyz Aug 8, 2023
00a075e
Update with pre-commit changes
cbrxyz Aug 8, 2023
65d92ee
Update pre-commit hooks to latest versions
pre-commit-ci[bot] Oct 2, 2023
0d1918c
Merging
cbrxyz Oct 10, 2023
dc47cc6
Merge remote-tracking branch 'origin' into pre-commit-ci-update-config
cbrxyz Oct 10, 2023
5fb3ef1
Update pre-commit hooks to latest versions
pre-commit-ci[bot] Nov 6, 2023
219d34a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 6, 2023
e9c6ec5
Update pre-commit dependencies to latest versions
cbrxyz Nov 6, 2023
efb9710
Fix spelling mistakes for codespell
cbrxyz Nov 6, 2023
740f752
Fix too short underline
cbrxyz Nov 6, 2023
97e7f7f
Update pre-commit hooks to latest versions
pre-commit-ci[bot] Jan 1, 2024
c2ec9a1
Merge conflict
cbrxyz Jan 21, 2024
962fc9c
Update wait-on-check-action action for dependency updates
cbrxyz Jan 27, 2024
64cd4cb
Update pre-commit hooks to latest versions
pre-commit-ci[bot] Feb 5, 2024
df856b0
Re-format files
cbrxyz Feb 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ repos:
hooks:
- id: yamllint
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.10.1
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
rev: v17.0.4
hooks:
- id: clang-format
- repo: https://github.com/PyCQA/autoflake
Expand All @@ -39,13 +39,12 @@ repos:
- id: shfmt
exclude: ^docker|deprecated|NaviGator/simulation/VRX
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.292'
rev: 'v0.1.4'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
args:
Expand Down Expand Up @@ -73,7 +72,7 @@ repos:
- id: prettier-package-xml
- id: sort-package-xml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down
2 changes: 1 addition & 1 deletion NaviGator/gnc/navigator_path_planner/nodes/path_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ def reevaluate_plan(self) -> None:
def action_check(self, _: rospy.timer.TimerEvent) -> None:
"""
Manages action preempting. Serves as the callback to a Timer operating
opereating every self.revisit_period seconds.
operating every self.revisit_period seconds.
"""
if self.preempted or not self.move_server.is_active():
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ def check_continuity(self, odom):
self._raised = True # Avoid raising multiple times
rospy.logwarn("ODOM DISCONTINUITY DETECTED")
self.ab.raise_alarm(
problem_description="ODOM DISCONTINUITY DETECTED. JUMPED {} METERS".format(
jump,
),
problem_description=f"ODOM DISCONTINUITY DETECTED. JUMPED {jump} METERS",
severity=5,
)
self.last_position = position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ dock_shape_1:
param: /mission/identify_dock/shape_1
options: [CIRCLE, TRIANGLE, CROSS, ANY]
description: >
The shape of the first bay to dock in during the dentify
The shape of the first bay to dock in during the identify
Symbols and Dock mission. If set to ANY, mission should dock based on the
color parameter and set this parameter during the mission
dock_color_1:
param: /mission/identify_dock/color_1
options: [RED, GREEN, BLUE, ANY]
description: >
The color of the first bay to dock in during the dentify Symbols and Dock
The color of the first bay to dock in during the identify Symbols and Dock
mission. If set to ANY, mission should dock based on the shape parameter
and set this parameter during the mission

Expand All @@ -174,7 +174,7 @@ dock_shape_2:
description: >
# yamllint disable-line rule:line-length
The shape of the second bay to dock in during the
dentify Symbols and Dock mission. If set to ANY,
identify Symbols and Dock mission. If set to ANY,
mission should dock based on the color parameter and set this
parameter during the mission
dock_color_2:
Expand All @@ -183,6 +183,6 @@ dock_color_2:
description: >
# yamllint disable-line rule:line-length
The color of the second bay to dock in during the
dentify Symbols and Dock mission.
identify Symbols and Dock mission.
If set to ANY, mission should dock based on the shape
parameter and set this parameter during the mission
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def decode_parameters(cls, parameters):
return parsed

async def run(self, args):
# Publish a velocity of zero for a while to stabalize navigator
# Publish a velocity of zero for a while to stabilize navigator
self.send_feedback("Switching trajectory to constant")
await self.change_trajectory("constant")
await self.nh.sleep(0.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async def run(self, parameters):
_, closest_reds = await self.get_sorted_objects("red_cylinder", 1)
_, closest_greens = await self.get_sorted_objects("green_cylinder", 1)

# Rename the totems for their symantic name
# Rename the totems for their semantic name
green_close = closest_greens[0]
red_close = closest_reds[0]

Expand All @@ -83,7 +83,7 @@ async def run(self, parameters):
_, closest_reds = await self.get_sorted_objects("red_cylinder", 2)
_, closest_greens = await self.get_sorted_objects("green_cylinder", 2)

# Rename the totems for their symantic name
# Rename the totems for their semantic name
green_far = closest_greens[1]
red_far = closest_reds[1]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ async def do_circle():
await self.nh.sleep(0.25)
continue
fprint(
"Shape ({}found, using normal to look at other 3 shapes if needed".format(
res[0],
),
f"Shape ({res[0]}found, using normal to look at other 3 shapes if needed",
title="DETECT DELIVER",
msg_color="green",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,7 @@ def as_MoveGoal(self, move_type=MoveGoal.DRIVE, **kwargs):
for key in kwargs:
if not hasattr(MoveGoal, key):
fprint(
"MoveGoal msg doesn't have a field called '{}' you tried to set via kwargs.".format(
key,
),
f"MoveGoal msg doesn't have a field called '{key}' you tried to set via kwargs.",
title="POSE_EDITOR",
msg_color="red",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ async def prepare_for_docking(self):
# This function looks at the two squares in front of the boat
# and it gets the middle pixel between the two squares.
# If the middle pixel is for some reason not in the middle of our camera...
# adjust the boat postiion before docking
# adjust the boat position before docking
print("prepare for landing!")

img = await self.front_left_camera_sub.get_next_message()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ void AerialMapDisplay::assembleScene()
// determine location of this tile, flipping y in the process
const double x = (tile.x() - loader_->centerTileX()) * tile_w + origin_x;
const double y = -(tile.y() - loader_->centerTileY()) * tile_h + origin_y;
// don't re-use any ids
// don't reuse any ids
const std::string name_suffix = std::to_string(tile.x()) + "_" + std::to_string(tile.y()) + "_" +
std::to_string(map_id_) + "_" + std::to_string(scene_id_);

Expand Down
2 changes: 1 addition & 1 deletion NaviGator/scripts/bash_aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nthrust() {
topic="/$1_motor/cmd"
publishers=$(rostopic info "$topic" | grep Publishers)
if [ "$publishers" != "Publishers: None" ]; then
echo "Somone is already publishing to $topic. Perhaps you need to kill thrust mapper?"
echo "Someone is already publishing to $topic. Perhaps you need to kill thrust mapper?"
return 1
fi
rostopic pub "$topic" "roboteq_msgs/Command" "setpoint: $2" -r100
Expand Down
2 changes: 1 addition & 1 deletion NaviGator/utils/navigator_msgs/srv/GetDockBays.srv
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
geometry_msgs/Point[3] bays #The positions in ENU frame of the center of the three bays 0=left, 1=center, 2=right
geometry_msgs/Vector3 normal #Vector or normal pointing away from plane of dock back
bool success #False if an error occurred getting dock bays
string error #Descripion of error if success=false
string error #Description of error if success=false
2 changes: 1 addition & 1 deletion NaviGator/utils/navigator_tools/nodes/navigator_status_tui
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class nav_tui:
self.panel.hide()
panel.update_panels()
self.rate = rospy.Rate(2) # Fixed rate for while loop to update at: 2 hz
# The following are default field initalizations for various values that that will be overwritten
# The following are default field initializations for various values that that will be overwritten
self.voltage = 0
self.wrench = None
self.LAT = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def check_for_timeout(self, joy: Joy):

def joy_recieved(self, joy: Joy) -> None:
"""
Button elements are being assigned and simplied to readable names. The
Button elements are being assigned and simplified to readable names. The
number of deployments or retractions for thrusters are being updated based
on several conditions. Moreover, additional settings are changed based on the
state of the controller and the activation of potential alarms or switches.
Expand Down
2 changes: 1 addition & 1 deletion NaviGator/utils/voltage_gui/src/voltage_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def resizeFont(self) -> None: # done
threshFont = QtGui.QFont("Times", (self.fontSize) / 3, QtGui.QFont.Bold)
self.labelThresh.setFont(threshFont)

# Sets the text of the thrshold info box
# Sets the text of the threshold info box
def initThresh(self) -> None:
"""
Sets the text of the threshold info box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dist_h: 2.286e-02
# speed of sound in water
v_sound: 1482
# target Frquency in Hz
# target Frequency in Hz
triggering/target_frequency: 30000
# tolerance around target frequerncy in Hz
triggering/frequency_tolerance: 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
<param name="frame_id" type="string" value="/imu"/>
<rosparam>
scale:
- [0.993770963897068, 0.00105871125374563, 7.659410525291767e-05]
- [0.00105871125374563, 0.9996814868251349, -0.0011040738267441828]
- [7.659410525291767e-05, -0.001104073826744163, 1.0065910531028952]
shift: [1.2551999807772446e-06, -1.1666595150804588e-06, 6.895773090438596e-08]
- [0.9991765357958566, 0.006242798579443988, -0.008472478269327878]
- [0.006242798579443957, 1.0016179705091928, 0.0059841151097914345]
- [-0.008472478269327836, 0.0059841151097913, 0.999354597532967]
shift: [7.889247409445414e-06, 4.879179471165382e-06, 7.46017199298374e-06]
</rosparam>
</node>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def detect(self, dice_img):
params.minConvexity = 0.8 # 1 = perfect convex hull
# Filter by Inertia
params.filterByInertia = True
params.minInertiaRatio = 0.4 # Defines the ellipsoid 1= detects only cirlces
params.minInertiaRatio = 0.4 # Defines the ellipsoid 1= detects only circles
# 0 = Detects even lines

# Create a detector with the parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class OrangeRectangleFinder:
* Transform this frames pose into /map frame
* Plug this frames pose in /map into a kalman filter to reduce noise

TODO: Allow for two objects to be identifed at once, both filtered through its own KF
TODO: Allow for two objects to be identified at once, both filtered through its own KF
"""

# Coordinate axes for debugging image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def return_pose(self, srv):
self.poly_generator = self.polygon_generator()
return [0, False, srv.intial_position]

# We search at 1.5 * r so that there is some overlay in the search feilds.
# We search at 1.5 * r so that there is some overlay in the search fields.
np_pose = msg_helpers.pose_to_numpy(srv.intial_position)
rot_mat = make_2D_rotation(
tf.transformations.euler_from_quaternion(np_pose[1])[2],
Expand Down
2 changes: 1 addition & 1 deletion docs/design/passive_sonar/passive_sonar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Configuration
*************
All parameters that are expected to be changed in tuining are ROS Params initialized in ``passive_sonar.yaml``

To make a custom configation
To make a custom configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* ``roscd subjugator_launch``
Expand Down
2 changes: 1 addition & 1 deletion docs/electrical/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ including meeting times.

## Join the electrical GitHub
Unlike the software and mechanical teams (who share a GitHub repository), we use
a separate repository for the electrical team. As a resut, you will need to be added
a separate repository for the electrical team. As a result, you will need to be added
to this organization. Once you're in Slack (or you've come to the lab), ask an electrical
leader to add you to the GitHub organization. The organization can be found [here](https://github.com/uf-mil-electrical).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Basic Usage Example

- Visualize this new topic in rviz by clicking `Add` and then `/odom2 -> Odometry`

- Watch the red arrow advance from where the sub started to where the sub stopped updting approximately 10 times a second.
- Watch the red arrow advance from where the sub started to where the sub stopped updating approximately 10 times a second.

Source Files
^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion docs/navigator/lessons22.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ future teams to learn from!
It is quicker to tell when tools have gone missing (as each tool now has a
dedicated spot in the organizer), and which tool is missing. Furthermore, it
becomes easier for software members, electrical members, and mentors to find
tools, even if they maybe are not acquianted with a deep knowledge of the
tools, even if they maybe are not acquainted with a deep knowledge of the
mechanical team.
* **Focus on bringing less and staying more organized.** - At RobotX 2022, we
were one of the teams who had brought the most equipment, yet we had a hard
Expand Down
2 changes: 1 addition & 1 deletion docs/software/adding_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ $ ./scripts/build_docs --scratch
```

## Contributing changes
Now that you have made and verifed your changes, follow the [contributing guide](contributing)
Now that you have made and verified your changes, follow the [contributing guide](contributing)
to add your changes to the repository.
2 changes: 1 addition & 1 deletion docs/software/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ launches the Gazebo GUI - aka, the thing you will actually interact with! If all
goes according to plan, you should see our robot in its own little world!

## Installing developer tools
After you have verified that your Git setup is working appopriately, take a look
After you have verified that your Git setup is working appropriately, take a look
at installing some developer tools on the [Developer Tools](/software/devtools)
page.

Expand Down
2 changes: 1 addition & 1 deletion docs/software/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ for examples of it being used.

## Search the internet
If your problem is not MIL-specific (issue with Linux, ROS, C++, etc),
somone has most likely had the same problem and written about it on the internet.
someone has most likely had the same problem and written about it on the internet.
You'll be surprised how often you can fix your issue by Googling the error.

## Search Slack
Expand Down
2 changes: 1 addition & 1 deletion docs/software/noetic_migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ before you commit.

Great, the code is now pretty! :D

If you ran `python-modernize`, it will have suggested some changes to you, indcated
If you ran `python-modernize`, it will have suggested some changes to you, indicated
by `+` and `-` signs. It may look something like this:

```diff
Expand Down
2 changes: 1 addition & 1 deletion mil_common/axros
2 changes: 1 addition & 1 deletion mil_common/drivers/mil_passive_sonar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package includes the main algorithm to find the direction of a pinger. It a
# Running:
Ensure that hydrophones -> ros is running and publishing a `mil_passive_sonar/Ping` msg.

Then run `roslaunch mil_passive_sonar mil_passive_sonar.lauch`
Then run `roslaunch mil_passive_sonar mil_passive_sonar.launch`

`mil_passive_sonar/FindPinger`

Expand Down
4 changes: 2 additions & 2 deletions mil_common/drivers/mil_passive_sonar/scripts/triggering.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_params(self):
self.enabled = rospy.get_param("~enable_on_launch")

# Attributes about our target frequency range
# target Frquency in Hz
# target Frequency in Hz
self.target = rospy.get_param("~target_frequency")
# tolerance around that frequerncy in Hz
tolerance = rospy.get_param("~frequency_tolerance")
Expand All @@ -121,7 +121,7 @@ def get_params(self):
self.v_sound = rospy.get_param("v_sound")

# Misc attributes
# minimum gradient of the max convolution wrt time to trigger a time of arivals calculation
# minimum gradient of the max convolution wrt time to trigger a time of arrivals calculation
self.threshold = rospy.get_param("~threshold")
self.trigger_offset = rospy.get_param("~trigger_offset")
# how far after the triggering time to make upper bound of samples at triggering in sec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ unsigned int select_hist_mode(std::vector<cv::Point> &histogram_modes, unsigned

// Takes in a grayscale image and segments out a semi-homogenous foreground
// object with pixel intensities close to <target>. Tuning of last three
// parameters may imrove results but default values should work well in
// parameters may improve results but default values should work well in
// most cases.
void statistical_image_segmentation(const cv::Mat &src, cv::Mat &dest, cv::Mat &debug_img, const int hist_size,
const float **ranges, const int target, std::string image_name = "Unnamed Image",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def classify_features(self, features: np.ndarray) -> int:

def feature_probabilities(self, features: np.ndarray) -> List[float]:
"""
Allows child classes to give probabilties for each possible class given
Allows child classes to give probabilities for each possible class given
a features vector, instead of just one classification. By default,
gives 1.0 to classified class and 0.0 to others.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def get_pose_3D(
cam (Optional[PinholeCameraModel]): The camera model.
rectified (bool): If ``cam`` is set, set True if corners were found in an
already rectified image (image_rect_color topic).
instrinsics (np.ndarray): Camera intrinisic matrix.
intrinsics (np.ndarray): Camera intrinisic matrix.
dist_coeffs (np.ndarray): Camera distortion coefficients.

Returns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def create_object_msg(
is needed/available in your application.

Args:
name (str): Name of the identifed object.
name (str): Name of the identified object.
attributes (str): Attributes to attach to message, the purpose and value
of this attribute will vary by application. Defaults to an empty string.
confidence (Optional[float]): Float between 0 and 1 describing the confidence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PcdColorizer::PcdColorizer(ros::NodeHandle nh, string input_pcd_topic)
}
catch (std::exception &e)
{
_err_msg = "COLORIZER: Suscriber or publisher error caught: "_s + e.what();
_err_msg = "COLORIZER: Subscriber or publisher error caught: "_s + e.what();
ROS_ERROR(_err_msg.c_str());
return;
}
Expand Down
Loading
Loading