Skip to content

Commit

Permalink
Merge #206
Browse files Browse the repository at this point in the history
206: Add spell checker to CI r=XFFXFF a=Aadamandersson

Added a spell checker (https://crates.io/crates/typos) to our CI.
Closes #147.

Co-authored-by: Adam Andersson <[email protected]>
  • Loading branch information
bors[bot] and Aadamandersson authored Aug 11, 2022
2 parents 18f166b + 9ff80b6 commit b7916c0
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ status = [
"Test (nightly)",
"Rustfmt",
"Clippy (nightly)",
"Deploy (nightly)"
"Deploy (nightly)",
"Typos"
]
delete_merged_branches = true
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,12 @@ jobs:
with:
command: clippy
args: -- -Dwarnings

typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: crate-ci/[email protected]
with:
config: ./.typos.toml
4 changes: 4 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[files]
extend-exclude = ["components/dada-web/ace/", "book/src/css/speech-bubbles.css", "book/package-lock.json"]
[default.extend-words]
fo = "fo"
2 changes: 1 addition & 1 deletion book/docs/dyn_tutorial/field_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ my w_a = pair.a # Error: `pair.a` has `our` permission
print(w_a).await
```

This might seem surprising, but think about it: if you have `our` permission, then there can be other variables that have `our` permision as well, and you can't *both* have `my` permission to the fields. Otherwise, in an example like this, both `w_a1` and `w_a2` would have `my` permission to the same `Widget`, and that can't be:
This might seem surprising, but think about it: if you have `our` permission, then there can be other variables that have `our` permission as well, and you can't *both* have `my` permission to the fields. Otherwise, in an example like this, both `w_a1` and `w_a2` would have `my` permission to the same `Widget`, and that can't be:

```
class Widget()
Expand Down
4 changes: 2 additions & 2 deletions book/docs/dyn_tutorial/lease.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import Caveat from '../caveat.md'

<Caveat/>

So far in the tutorial, we've worked exclusively with the two **owned** permisions, `my` and `our`. Owned permissions have the property that they are independent from all other variables. When you have owned permission to an object, [nobody can take that away from you](./our.md#why-cant-we-invalidate-other-our-values). (In the case of `our`, you might only have read permission, but that read permisson cannot be revoked.)
So far in the tutorial, we've worked exclusively with the two **owned** permissions, `my` and `our`. Owned permissions have the property that they are independent from all other variables. When you have owned permission to an object, [nobody can take that away from you](./our.md#why-cant-we-invalidate-other-our-values). (In the case of `our`, you might only have read permission, but that read permission cannot be revoked.)

Sometimes, though, we want to give people **temporary** access to an object that we own, without giving up control. In Dada, this is called a **lease**, and it works in a very similar way to how an ["at will" lease] works in "real life". If one variable `a` owns an object, it can lease out that object to another variable `b` temporarily. `b` can use the object up until `a` wants it back.

["at will" lease]: https://en.wikipedia.org/wiki/Leasehold_estate#Tenancy_at_will

## The permissions table

Leased permissions complete the "permisions table" that we saw earlier:
Leased permissions complete the "permissions table" that we saw earlier:

| | Unique | Shared |
| ---------- | -------- | ---------- |
Expand Down
2 changes: 1 addition & 1 deletion book/docs/dyn_tutorial/my.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ When you assign to the `my q` variable, you are actually **giving** ownership fr

## Visualizing permissions with the debugger

Dada comes equipped with a visual debugger that can help you to understand how permisions work. Let's try it! Position the cursor at the end of the first line:
Dada comes equipped with a visual debugger that can help you to understand how permissions work. Let's try it! Position the cursor at the end of the first line:

```
class Point(our x, our y)
Expand Down
4 changes: 2 additions & 2 deletions book/docs/dyn_tutorial/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ q = p
# ───┘
# put your cursor here -- you will see a diagram below
# that shows that while `p` and `q` reference the same
# point, `q` has read permisions (indicated with a blue
# point, `q` has read permissions (indicated with a blue
# line).
```

## Requesting write permission

You can explicitly request write permision by using the `lease` keyword, like `p.lease`. If you use the debugger and position it after `q = p.lease`, you will see that `q` is given write permission this time. As a result, `q.x := 23` succeeds and, when we print the variable `p`, we see the new value.
You can explicitly request write permission by using the `lease` keyword, like `p.lease`. If you use the debugger and position it after `q = p.lease`, you will see that `q` is given write permission this time. As a result, `q.x := 23` succeeds and, when we print the variable `p`, we see the new value.

```dada ide
class Point(x, y)
Expand Down
2 changes: 1 addition & 1 deletion components/dada-execute/src/heap_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ tables! {
pub(crate) struct Tables {
stack_frame_nodes: alloc StackFrameNode => StackFrameNodeData,
objects: alloc ObjectNode => ObjectNodeData,
datas: alloc DataNode => DataNodeData,
data_nodes: alloc DataNode => DataNodeData,
permissions: alloc PermissionNode => PermissionNodeData,
value_edges: alloc ValueEdge => ValueEdgeData,
}
Expand Down
2 changes: 1 addition & 1 deletion components/dada-execute/src/step/traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub(super) struct AccumulatedPermissions {
}

impl AccumulatedPermissions {
/// Returns the permisions one would have when accessing
/// Returns the permissions one would have when accessing
/// a uniquely owned location with the given "atomic"-ness.
pub fn unique(atomic: Atomic) -> Self {
AccumulatedPermissions {
Expand Down
2 changes: 1 addition & 1 deletion components/dada-ir/src/lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl LineTable {
if wc.start >= position {
break;
}
// e.g.: 🙂 will have len 4, but we count it as 1 character, so we substract 3
// e.g.: 🙂 will have len 4, but we count it as 1 character, so we subtract 3
column0 -= wc.len() - 1;
}
LineColumn::new0(line0, column0)
Expand Down
4 changes: 2 additions & 2 deletions components/dada-validate/src/validate/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl<'me> Validator<'me> {
/// Given an expression `E`, takes ownership of its value:
///
/// * If `E` is a place expression, like `a.b`, this is equivalent to `a.b.give`
/// * If `E` is a value expression, like `foo()`, this just evalutes `E`
/// * If `E` is a value expression, like `foo()`, this just evaluates `E`
///
/// The `move_expr` argument indicates the expression causing the move (e.g., the `give` expr
/// or the `await` expr).
Expand All @@ -190,7 +190,7 @@ impl<'me> Validator<'me> {
/// Validates an expression into a value:
///
/// * If `E` is a place expression, like `a.b`, this is equivalent to `a.b.share`
/// * If `E` is a value expression, like `foo()`, this just evalutes it
/// * If `E` is a value expression, like `foo()`, this just evaluates it
#[tracing::instrument(level = "debug", skip(self, expr))]
fn validate_expr(&mut self, expr: syntax::Expr) -> validated::Expr {
tracing::trace!("expr.data = {:?}", expr.data(self.syntax_tables()));
Expand Down

0 comments on commit b7916c0

Please sign in to comment.