diff --git a/DESIGN.md b/DESIGN.md index 9c722e8e2..e6fb2862e 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -65,7 +65,7 @@ linear space. There are multiple ways to build a `BriDoc`, not all of which fit in linear space. So care is necessary to keep memory bounded. -The compexities of the `BriDoc` structure, together with the lack of +The complexities of the `BriDoc` structure, together with the lack of documentation, make Brittany at least challenging to maintain. ### Hindent @@ -386,7 +386,7 @@ but arguably stills achieves consistent style. Forking or contributing to Hindent is not an option because if we replace `haskell-src-exts` with `ghc` (or `ghc-exact-print`) then we'll have to work with a different AST type and all the code in Hindent will become -incompatible and there won't be much code to be re-used in that case. It is +incompatible and there won't be much code to be reused in that case. It is also possible that we'll find a nicer way to write pretty-printer. ## Examples diff --git a/app/Main.hs b/app/Main.hs index 8348fdc04..e529f5b37 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -361,7 +361,7 @@ configParser = help "Fail if formatting is not idempotent" ] -- We cannot parse the source type here, because we might need to do - -- autodection based on the input file extension (not available here) + -- autodetection based on the input file extension (not available here) -- before storing the resolved value in the config struct. <*> pure ModuleSource <*> (option parseColorMode . mconcat) diff --git a/data/examples/declaration/data/record-out.hs b/data/examples/declaration/data/record-out.hs index 7de59452f..9371f60b4 100644 --- a/data/examples/declaration/data/record-out.hs +++ b/data/examples/declaration/data/record-out.hs @@ -12,7 +12,7 @@ data Foo = Foo fooGag, fooGog :: NonEmpty - ( Indentity + ( Identity Bool ), -- | Huh! diff --git a/data/examples/declaration/data/record.hs b/data/examples/declaration/data/record.hs index 89b5567de..bac906fb8 100644 --- a/data/examples/declaration/data/record.hs +++ b/data/examples/declaration/data/record.hs @@ -6,7 +6,7 @@ data Foo = Foo { fooX :: Int -- ^ X , fooY :: Int -- ^ Y , fooBar, fooBaz :: NonEmpty (Identity Bool) -- ^ BarBaz - , fooGag, fooGog :: NonEmpty (Indentity + , fooGag, fooGog :: NonEmpty (Identity Bool) -- ^ GagGog , fooFoo diff --git a/data/examples/declaration/rewrite-rule/prelude2-out.hs b/data/examples/declaration/rewrite-rule/prelude2-out.hs index 2f07a8d75..007a9ea7d 100644 --- a/data/examples/declaration/rewrite-rule/prelude2-out.hs +++ b/data/examples/declaration/rewrite-rule/prelude2-out.hs @@ -11,7 +11,7 @@ -- when we disable the rule that expands (++) into foldr -- The foldr/cons rule looks nice, but it can give disastrously --- bloated code when commpiling +-- bloated code when compiling -- array (a,b) [(1,2), (2,2), (3,2), ...very long list... ] -- i.e. when there are very very long literal lists -- So I've disabled it for now. We could have special cases diff --git a/data/examples/declaration/rewrite-rule/prelude2.hs b/data/examples/declaration/rewrite-rule/prelude2.hs index 9c8081c8f..79990b23c 100644 --- a/data/examples/declaration/rewrite-rule/prelude2.hs +++ b/data/examples/declaration/rewrite-rule/prelude2.hs @@ -11,7 +11,7 @@ -- when we disable the rule that expands (++) into foldr -- The foldr/cons rule looks nice, but it can give disastrously --- bloated code when commpiling +-- bloated code when compiling -- array (a,b) [(1,2), (2,2), (3,2), ...very long list... ] -- i.e. when there are very very long literal lists -- So I've disabled it for now. We could have special cases diff --git a/data/examples/declaration/value/function/arrow/proc-do-complex-out.hs b/data/examples/declaration/value/function/arrow/proc-do-complex-out.hs index eef06bf5d..9bf87e021 100644 --- a/data/examples/declaration/value/function/arrow/proc-do-complex-out.hs +++ b/data/examples/declaration/value/function/arrow/proc-do-complex-out.hs @@ -12,7 +12,7 @@ foo ) -> do -- Begin do - (x, y) <- -- GHC parser fails if layed out over multiple lines + (x, y) <- -- GHC parser fails if laid out over multiple lines f -- Call into f ( a, c -- Tuple together arguments diff --git a/data/examples/declaration/value/function/arrow/proc-do-complex.hs b/data/examples/declaration/value/function/arrow/proc-do-complex.hs index f4cce670a..bf80be85a 100644 --- a/data/examples/declaration/value/function/arrow/proc-do-complex.hs +++ b/data/examples/declaration/value/function/arrow/proc-do-complex.hs @@ -9,7 +9,7 @@ foo (e, f) ) -> do -- Begin do - (x,y) -- GHC parser fails if layed out over multiple lines + (x,y) -- GHC parser fails if laid out over multiple lines <- f -- Call into f (a, c) -- Tuple together arguments diff --git a/src/Ormolu/Printer/Meat/Common.hs b/src/Ormolu/Printer/Meat/Common.hs index 73664570a..aada158aa 100644 --- a/src/Ormolu/Printer/Meat/Common.hs +++ b/src/Ormolu/Printer/Meat/Common.hs @@ -47,7 +47,7 @@ data FamilyStyle | -- | Top-level declarations Free --- | Outputs the name of the module-like entity, preceeded by the correct prefix ("module" or "signature"). +-- | Outputs the name of the module-like entity, preceded by the correct prefix ("module" or "signature"). p_hsmodName :: ModuleName -> R () p_hsmodName mname = do sourceType <- askSourceType @@ -92,7 +92,7 @@ p_rdrName l = located l $ \x -> do -- insert spaces when we have a parenthesized operator starting with `#`. handleUnboxedSumsAndHashInteraction | unboxedSums, - -- Qualified names do not start wth a `#`. + -- Qualified names do not start with a `#`. Unqual (occNameString -> '#' : _) <- x = \y -> space *> y <* space | otherwise = id diff --git a/src/Ormolu/Printer/Meat/Declaration/Value.hs b/src/Ormolu/Printer/Meat/Declaration/Value.hs index 2f6f0cc22..1b2d40871 100644 --- a/src/Ormolu/Printer/Meat/Declaration/Value.hs +++ b/src/Ormolu/Printer/Meat/Declaration/Value.hs @@ -121,7 +121,7 @@ p_matchGroup' placer render style mg@MG {..} = do -- | Function id obtained through pattern matching on 'FunBind' should not -- be used to print the actual equations because the different ‘RdrNames’ -- used in the equations may have different “decorations” (such as backticks --- and paretheses) associated with them. It is necessary to use per-equation +-- and parentheses) associated with them. It is necessary to use per-equation -- names obtained from 'm_ctxt' of 'Match'. This function replaces function -- name inside of 'Function' accordingly. adjustMatchGroupStyle :: @@ -588,7 +588,7 @@ p_hsExpr :: HsExpr GhcPs -> R () p_hsExpr = p_hsExpr' NotApplicand N -- | An applicand is the left-hand side in a function application, i.e. @f@ in --- @f a@. We need to track this in order to add extra identation in cases like +-- @f a@. We need to track this in order to add extra indentation in cases like -- -- > foo = -- > do diff --git a/tests/Ormolu/Fixity/ParserSpec.hs b/tests/Ormolu/Fixity/ParserSpec.hs index d6aa4904a..b49e515bb 100644 --- a/tests/Ormolu/Fixity/ParserSpec.hs +++ b/tests/Ormolu/Fixity/ParserSpec.hs @@ -214,7 +214,7 @@ spec = do elabel "module name" ] ) - it "fails with correct parse error (typo: export intead exports)" $ + it "fails with correct parse error (typo: export instead exports)" $ parseModuleReexportDeclaration "module Control.Lens export Control.Lens.Lens" `shouldFailWith` err 20