Skip to content

Commit 05bc7b4

Browse files
authored
Fix typos and grammatical issues (#37)
* Fix typos in comments and docs; add typos config for intentional patterns * Fix grammatical issues in documentation and comments * Remove _typos.toml
1 parent 462601e commit 05bc7b4

8 files changed

Lines changed: 14 additions & 14 deletions

File tree

CHECKERS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public_path: my/custom/path/
3333
### Defining public constants through sigil
3434

3535
> [!WARNING]
36-
> This way of of defining the public API of a package should be considered WIP. It is not supported by all tooling in the RubyAtScale ecosystem, as @alexevanczuk pointed out in a [comment on the PR](https://github.com/rubyatscale/packwerk-extensions/pull/35#discussion_r1334331797):
36+
> This way of defining the public API of a package should be considered WIP. It is not supported by all tooling in the RubyAtScale ecosystem, as @alexevanczuk pointed out in a [comment on the PR](https://github.com/rubyatscale/packwerk-extensions/pull/35#discussion_r1334331797):
3737
>
3838
> There are a couple of other places that will require changes related to this sigil. Namely, everything that is coupled to the public folder implementation of privacy.
3939
>
@@ -196,7 +196,7 @@ enforce_visibility: true
196196
enforcement_globs_ignore:
197197
- enforcements:
198198
- privacy
199-
- visiblity
199+
- visibility
200200
ignores:
201201
- "**/*"
202202
# Enforce incoming privacy and visibility violation references _only_ in `pks/product_services/serv1/**/*`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Currently, it ships the following checkers to help improve the boundaries betwee
1010
- A `dependency` checker requires that a pack specifies packs on which it depends. Cyclic dependencies are not allowed. See [packwerk](https://github.com/Shopify/packwerk)
1111
- A `privacy` checker that ensures other packages are using your package's public API
1212
- A `visibility` checker that allows packages to be private except to an explicit group of other packages.
13-
- A `folder_privacy` checker that allows packages to their sibling packs and parent pack (to be used in an application that uses folder packs)
13+
- A `folder_privacy` checker that allows packages to be private to their sibling packs and parent pack (to be used in an application that uses folder packs)
1414
- A `layer` (formerly `architecture`) checker that allows packages to specify their "layer" and requires that each layer only communicate with layers below it.
1515

1616
See [Checkers](CHECKERS.md) for detailed descriptions.

dev/notes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Performance
88
Although `pks` is intended to be fast, there are ways it can be made a lot faster!
9-
- Conditional cache usage. For example, implemented as an LSP, pks could always use cache and only bust specific caches (asychronously) when certain events (e.g. file changes) are received.
9+
- Conditional cache usage. For example, implemented as an LSP, pks could always use cache and only bust specific caches (asynchronously) when certain events (e.g. file changes) are received.
1010
- By using modified time, we can avoid opening the entire file and parsing it and calculating the md5 hash. It's possible this would not be a meaningful performance improvement.
1111

1212
### Improved use of references (less cloning)
@@ -41,13 +41,13 @@ time cargo run --profile=release -- --debug --project-root=../your_app check
4141
# Packwerk Implementation Considerations
4242
- See `EXPERIMENTAL_PARSER_USAGE.md` for more info
4343
- Packwerk considers a definition to be a reference. I explored removing this in this branch: https://github.com/alexevanczuk/packs/pull/44
44-
- This results in a diff in violations, because if a class opens up a module defined by another class, its considered to be a reference to that other class.
45-
- I think this is actually a bug in packwerk, since a definition is not really a reference. Even though monkey patching / opening up other moduels is not great, we should surface that information through a different mechanism (such as allowing packs to have a monkey patches violation)
44+
- This results in a diff in violations, because if a class opens up a module defined by another class, it's considered to be a reference to that other class.
45+
- I think this is actually a bug in packwerk, since a definition is not really a reference. Even though monkey patching / opening up other modules is not great, we should surface that information through a different mechanism (such as allowing packs to have a monkey patches violation)
4646

4747
# Abandoned Performance Improvement Attempts
4848
- In https://github.com/alexevanczuk/packs/pull/37, I looked into getting the constants *as* we are walking the directory. However, I found that this was hardly much more performant than the current implementation, and it was much more complex. I abandoned this approach in favor of caching the resolver and other performance improvements.
49-
- We could consider caching the RESOLVED references in a file, which would allow us to potentially skip generating the constant resolver and resolving all of the unresolved constants. This makes cache invalidation more complex though, and the flamegraph shows that most of the time is spent opening files, not resolving constants. Furthermore, the experimental constant resolver resolves constant much more quickly.
50-
- In https://github.com/alexevanczuk/packs/pull/98, I looked into having a single file as the cache rather than one cache file per code file. This turned out to be a *lot* slower, and I think the reason is that serialization and deserialization happens does not happen in parallel with one large file, where it does happen with lots of tiny files.
49+
- We could consider caching the RESOLVED references in a file, which would allow us to potentially skip generating the constant resolver and resolving all of the unresolved constants. This makes cache invalidation more complex though, and the flamegraph shows that most of the time is spent opening files, not resolving constants. Furthermore, the experimental constant resolver resolves constants much more quickly.
50+
- In https://github.com/alexevanczuk/packs/pull/98, I looked into having a single file as the cache rather than one cache file per code file. This turned out to be a *lot* slower, and I think the reason is that serialization and deserialization does not happen in parallel with one large file, where it does happen with lots of tiny files.
5151
- In https://github.com/alexevanczuk/packs/pull/99, I began (very initial stages) of integrating with SQLite to hopefully provide a faster cache. It's not clear to me if this would actually provide much of a performance improvement. It might still be worth exploring, but for now abandoning it since it introduces a lot of complexity.
5252

5353
# Modular Architecture

src/packs/checker/reference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl Reference {
122122
} else {
123123
let defining_pack_name = None;
124124
let relative_defining_file = None;
125-
// Contant name is not known, so we'll just use the unresolved name for now
125+
// Constant name is not known, so we'll just use the unresolved name for now
126126
let constant_name = unresolved_reference.name.clone();
127127

128128
Ok(vec![Reference {

src/packs/package_todo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn write_violations_to_disk(
135135
violations: HashSet<Violation>,
136136
) {
137137
debug!("Starting writing violations to disk");
138-
// First we need to group the violations by the repsonsible pack, which today is always the referencing pack
138+
// First we need to group the violations by the responsible pack, which today is always the referencing pack
139139
// Later if we change where a violation shows up, we should delegate to the checker
140140
// to decide what pack it should be in.
141141
let mut violations_by_responsible_pack: HashMap<String, Vec<Violation>> =

src/packs/parsing/ruby/experimental/constant_resolver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl ExperimentalConstantResolver {
118118
//
119119
// The `current_namespace_path` here is: ['Foo', 'Bar', 'Baz']
120120
// The `const_name` here is: `Boo`
121-
// Ruby constant resolution rules dictate that `Boo` coudl refer to any of the following,
121+
// Ruby constant resolution rules dictate that `Boo` could refer to any of the following,
122122
// in this specific order:
123123
//
124124
// ::Foo::Bar::Baz::Boo

src/packs/parsing/ruby/packwerk/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ pub(crate) fn process_from_contents(
292292
== r.location.start_row
293293
&& location.start_col == r.location.start_col;
294294
// In lib/packwerk/parsed_constant_definitions.rb, we don't count references when the reference is in the same place as the definition
295-
// This is an idiosyncracy we are porting over here for behavioral alignment, although we might be doing some unnecessary work.
295+
// This is an idiosyncrasy we are porting over here for behavioral alignment, although we might be doing some unnecessary work.
296296
should_ignore_local_reference = !reference_is_definition;
297297
}
298298
}

src/packs/parsing/ruby/zeitwerk/constant_resolver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl ZeitwerkConstantResolver {
138138
//
139139
// The `current_namespace_path` here is: ['Foo', 'Bar', 'Baz']
140140
// The `const_name` here is: `Boo`
141-
// Ruby constant resolution rules dictate that `Boo` coudl refer to any of the following,
141+
// Ruby constant resolution rules dictate that `Boo` could refer to any of the following,
142142
// in this specific order:
143143
//
144144
// ::Foo::Bar::Baz::Boo
@@ -162,7 +162,7 @@ impl ZeitwerkConstantResolver {
162162
if let Some(constant) =
163163
self.constant_for_fully_qualified_name(&fully_qualified_name_guess)
164164
{
165-
// Since the ContantResolver might say that some constant Foo::Bar::Baz is defined in Foo::Bar,
165+
// Since the ConstantResolver might say that some constant Foo::Bar::Baz is defined in Foo::Bar,
166166
// we want to return a ConstantDefinition that has the fully qualified name of the constant we're looking for.
167167
// In this case, we want to return a ConstantDefinition with the fully qualified name of Foo::Bar::Baz
168168
// even though the ConstantDefinition we found has the fully qualified name of Foo::Bar

0 commit comments

Comments
 (0)