Skip to content

Commit

Permalink
Merge pull request #539 from EricLBuehler/typos
Browse files Browse the repository at this point in the history
Fix some typos and add automatic typos check to CI
  • Loading branch information
haixuanTao authored Jun 8, 2024
2 parents d4ff586 + 8adb6e0 commit 685b01e
Show file tree
Hide file tree
Showing 24 changed files with 42 additions and 29 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,16 @@ jobs:
- run: cargo install cargo-lichking
- name: "Check dependency licenses"
run: cargo lichking check

typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Typos check with custom config file
uses: crate-ci/typos@master
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
- Use read_line instead of next_line in stderr by @haixuanTao in https://github.com/dora-rs/dora/pull/325
- Add a `rust-ros2-dataflow` example using the dora-ros2-bridge by @phil-opp in https://github.com/dora-rs/dora/pull/324
- Removing patchelf by @haixuanTao in https://github.com/dora-rs/dora/pull/333
- Improving python example readibility by @haixuanTao in https://github.com/dora-rs/dora/pull/334
- Improving python example readability by @haixuanTao in https://github.com/dora-rs/dora/pull/334
- Use `serde_bytes` to serialize `Vec<u8>` by @haixuanTao in https://github.com/dora-rs/dora/pull/336
- Adding support for `Arrow List(*)` for Python by @haixuanTao in https://github.com/dora-rs/dora/pull/337
- Bump rustls-webpki from 0.100.1 to 0.100.2 by @dependabot in https://github.com/dora-rs/dora/pull/340
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Opentelemetry is language independent, backend agnostic, and easily collect dist
dora-rs implements Hot-Reloading for python which means you can change code at runtime in Python while keeping your state intact.

Using the feature flag: `--attach --hot-reload`, dora-rs watch for code change and reload nodes that has been modified.
You can check fail-safe mecanism at: https://github.com/dora-rs/dora/pull/239
You can check fail-safe mechanism at: https://github.com/dora-rs/dora/pull/239

<a href="http://www.youtube.com/watch?v=NvvTEP8Jak8">
<img align="center" width="600" alt="demo" src=http://img.youtube.com/vi/NvvTEP8Jak8/0.jpg>
Expand Down
2 changes: 1 addition & 1 deletion apis/c/operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "dora-operator-api-c"
version.workspace = true
edition = "2021"
description = "C API implemetation for Dora Operator"
description = "C API implementation for Dora Operator"
documentation.workspace = true
license.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion apis/python/node/dora/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ at any point without it being considered a breaking change."""
def publish(self, data: pyarrow.Array) -> None:
"""Publish a message into ROS2 topic.
Remember that the data format should respect the structure of the ROS2 message usinng an arrow Structure.
Remember that the data format should respect the structure of the ROS2 message using an arrow Structure.
ex:
```python
Expand Down
8 changes: 4 additions & 4 deletions binaries/cli/src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
use termcolor::{Color, ColorChoice, ColorSpec, WriteColor};

pub fn check_environment(coordinator_addr: SocketAddr) -> eyre::Result<()> {
let mut error_occured = false;
let mut error_occurred = false;

let color_choice = if std::io::stdout().is_terminal() {
ColorChoice::Auto
Expand All @@ -29,7 +29,7 @@ pub fn check_environment(coordinator_addr: SocketAddr) -> eyre::Result<()> {
Err(_) => {
let _ = stdout.set_color(ColorSpec::new().set_fg(Some(Color::Red)));
writeln!(stdout, "not running")?;
error_occured = true;
error_occurred = true;
None
}
};
Expand All @@ -49,13 +49,13 @@ pub fn check_environment(coordinator_addr: SocketAddr) -> eyre::Result<()> {
} else {
let _ = stdout.set_color(ColorSpec::new().set_fg(Some(Color::Red)));
writeln!(stdout, "not running")?;
error_occured = true;
error_occurred = true;
}
let _ = stdout.reset();

writeln!(stdout)?;

if error_occured {
if error_occurred {
bail!("Environment check failed.");
}

Expand Down
2 changes: 1 addition & 1 deletion binaries/cli/src/template/c/operator/operator-template.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ OnEventResult_t dora_on_event(

int data_alloc_size = 10;
void *out_data = malloc(data_alloc_size);
// TODO intialize out_data
// TODO initialize out_data

Output_t output = {.id = {
.ptr = (uint8_t *)out_id_heap,
Expand Down
2 changes: 1 addition & 1 deletion binaries/coordinator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn resolve_name(
} else if let [uuid] = archived_uuids.as_slice() {
Ok(*uuid)
} else {
// TOOD: Index the archived dataflows in order to return logs based on the index.
// TODO: Index the archived dataflows in order to return logs based on the index.
bail!("multiple archived dataflows found with name `{name}`, Please provide the UUID instead.");
}
} else if let [uuid] = uuids.as_slice() {
Expand Down
2 changes: 1 addition & 1 deletion binaries/daemon/src/pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl PendingNodes {
let external_error = if success {
None
} else {
Some("some nodes failed to initalize on remote machines".to_string())
Some("some nodes failed to initialize on remote machines".to_string())
};
self.answer_subscribe_requests(external_error).await;

Expand Down
2 changes: 1 addition & 1 deletion binaries/runtime/src/operator/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ mod callback_impl {
/// Send an output from the operator:
/// - the first argument is the `output_id` as defined in your dataflow.
/// - the second argument is the data as either bytes or pyarrow.Array for zero copy.
/// - the third argument is dora metadata if you want ot link the tracing from one input into an output.
/// - the third argument is dora metadata if you want to link the tracing from one input into an output.
/// `e.g.: send_output("bbox", pa.array([100], type=pa.uint8()), dora_event["metadata"])`
#[pymethods]
impl SendOutputCallback {
Expand Down
2 changes: 1 addition & 1 deletion examples/c++-ros2-dataflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This examples requires a sourced ROS2 installation.

## Running pub/sub example

A ROS2 client to pubish turtlesim ROS2 messages and a DORA node can subscribe and visualize it.
A ROS2 client to publish turtlesim ROS2 messages and a DORA node can subscribe and visualize it.

From terminal 1 , sourcing the ROS2 installation and start ROS2 turtlesim window
```
Expand Down
2 changes: 1 addition & 1 deletion examples/c++-ros2-dataflow/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{env::consts::EXE_SUFFIX, path::Path};

#[tokio::main]
async fn main() -> eyre::Result<()> {
set_up_tracing("c++-ros2-dataflow-exaple").wrap_err("failed to set up tracing")?;
set_up_tracing("c++-ros2-dataflow-example").wrap_err("failed to set up tracing")?;

if cfg!(windows) {
tracing::error!(
Expand Down
2 changes: 1 addition & 1 deletion examples/cmake-dataflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ See also [c++-example](https://github.com/dora-rs/dora/blob/main/examples/c%2B%2

To try it out, you can use the [`run.rs`](./run.rs) binary. It performs all required build steps and then starts the dataflow. Use the following command to run it: `cargo run --example cmake-dataflow`.

## Out-of-tree complie
## Out-of-tree compile

This example also can be ran in a separate root directory.
```
Expand Down
2 changes: 1 addition & 1 deletion examples/python-dataflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This examples shows how to create and connect dora operators and custom nodes in
The [`dataflow.yml`](./dataflow.yml) defines a simple dataflow graph with the following three nodes:

- a webcam node, that connects to your webcam and feed the dataflow with webcam frame as jpeg compressed bytearray.
- an object detection node, that apply Yolo v5 on the webcam image. The model is imported from Pytorch Hub. The output is the bouding box of each object detected, the confidence and the class. You can have more info here: https://pytorch.org/hub/ultralytics_yolov5/
- an object detection node, that apply Yolo v5 on the webcam image. The model is imported from Pytorch Hub. The output is the bounding box of each object detected, the confidence and the class. You can have more info here: https://pytorch.org/hub/ultralytics_yolov5/
- a window plotting node, that will retrieve the webcam image and the Yolov5 bounding box and join the two together.

## Getting started
Expand Down
2 changes: 1 addition & 1 deletion examples/python-operator-dataflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This examples shows how to create and connect dora operators and custom nodes in
The [`dataflow.yml`](./dataflow.yml) defines a simple dataflow graph with the following three nodes:

- a webcam node, that connects to your webcam and feed the dataflow with webcam frame as jpeg compressed bytearray.
- an object detection node, that apply Yolo v5 on the webcam image. The model is imported from Pytorch Hub. The output is the bouding box of each object detected, the confidence and the class. You can have more info here: https://pytorch.org/hub/ultralytics_yolov5/
- an object detection node, that apply Yolo v5 on the webcam image. The model is imported from Pytorch Hub. The output is the bounding box of each object detected, the confidence and the class. You can have more info here: https://pytorch.org/hub/ultralytics_yolov5/
- a window plotting node, that will retrieve the webcam image and the Yolov5 bounding box and join the two together.

## Getting started
Expand Down
2 changes: 1 addition & 1 deletion examples/python-operator-dataflow/file_saver_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Operator:
"""
Infering object from images
Inferring object from images
"""

def __init__(self):
Expand Down
4 changes: 2 additions & 2 deletions examples/python-operator-dataflow/llm_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

CODE_MODIFIER_TEMPLATE = """
### Instruction
Respond with the small modified code only. No explaination.
Respond with the small modified code only. No explanation.
```python
{code}
Expand All @@ -27,7 +27,7 @@

MESSAGE_SENDER_TEMPLATE = """
### Instruction
You're a json expert. Format your response as a json with a topic and a data field in a ```json block. No explaination needed. No code needed.
You're a json expert. Format your response as a json with a topic and a data field in a ```json block. No explanation needed. No code needed.
The schema for those json are:
- line: Int[4]
Expand Down
2 changes: 1 addition & 1 deletion examples/python-operator-dataflow/object_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class Operator:
"""
Infering object from images
Inferring object from images
"""

def on_event(
Expand Down
2 changes: 1 addition & 1 deletion examples/rerun-viewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cargo install --git https://github.com/dora-rs/dora dora-rerun
dora start dataflow.yml --attach
```

You will see two visualizations. One from matplotlib and one from rerun for comparaison.
You will see two visualizations. One from matplotlib and one from rerun for comparison.

## CI/CD

Expand Down
4 changes: 2 additions & 2 deletions libraries/extensions/ros2-bridge/msg-gen/src/parser/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ mod test {

#[test]
fn parse_member_name_should_fail_if_starting_with_underscore() {
assert!(member_name("_invalid_indentifier").is_err());
assert!(member_name("_invalid_identifier").is_err());
}

#[test]
fn parse_member_name_should_fail_if_starting_with_number() {
assert!(member_name("0invalid_indentifier").is_err());
assert!(member_name("0invalid_identifier").is_err());
}

#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn parse_service_string(pkg_name: &str, srv_name: &str, service_string: &str) ->
let service_blocks: Vec<_> = re.split(service_string).collect();
if service_blocks.len() != 2 {
return Err(RclMsgError::InvalidServiceSpecification(format!(
"Expect one '---' seperator in {}/{} service definition, but get {}",
"Expect one '---' separator in {}/{} service definition, but get {}",
pkg_name,
srv_name,
service_blocks.len() - 1
Expand Down
4 changes: 2 additions & 2 deletions libraries/extensions/ros2-bridge/msg-gen/src/types/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl Action {
let feedback_type = format_ident!("{}_Feedback", self.name);
let send_goal_type = format_ident!("{}_SendGoal", self.name);
let get_result_type = format_ident!("{}_GetResult", self.name);
let feeback_message_type = format_ident!("{}_FeedbackMessage", self.name);
let feedback_message_type = format_ident!("{}_FeedbackMessage", self.name);

let goal_body = self.goal.token_stream();
let result_body = self.result.token_stream();
Expand Down Expand Up @@ -180,7 +180,7 @@ impl Action {
type Feedback = #feedback_type;
type SendGoal = #send_goal_type;
type GetResult = #get_result_type;
type FeedbackMessage = #feeback_message_type;
type FeedbackMessage = #feedback_message_type;

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mulitple levels of nested messages
# Multiple levels of nested messages
Arrays[3] array_of_arrays
BoundedSequences[3] array_of_bounded_sequences
UnboundedSequences[3] array_of_unbounded_sequences
Expand Down
2 changes: 1 addition & 1 deletion libraries/extensions/ros2-bridge/python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ pub struct Ros2Publisher {
impl Ros2Publisher {
/// Publish a message into ROS2 topic.
///
/// Remember that the data format should respect the structure of the ROS2 message usinng an arrow Structure.
/// Remember that the data format should respect the structure of the ROS2 message using an arrow Structure.
///
/// ex:
/// ```python
Expand Down

0 comments on commit 685b01e

Please sign in to comment.