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

Add codespell support (config, workflow to detect/not fix) and make it fix few typos #291

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,.codespellrc
check-hidden = true
ignore-regex = \b(TE|catchE|Ser|BU|bu)\b
# ignore-words-list =
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
4 changes: 2 additions & 2 deletions Aws/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ queryToHttpRequest SignedQuery{..} = do
++ sqOtherHeaders
, HTTP.requestBody =

-- An explicityly defined body parameter should overwrite everything else.
-- An explicitly defined body parameter should overwrite everything else.
case sqBody of
Just x -> x
Nothing ->
Expand All @@ -524,7 +524,7 @@ queryToHttpRequest SignedQuery{..} = do
PostQuery -> Just "application/x-www-form-urlencoded; charset=utf-8"
_ -> Nothing

-- | Create a URI fro a 'SignedQuery' object.
-- | Create a URI from a 'SignedQuery' object.
--
-- Unused / incompatible fields will be silently ignored.
queryToUri :: SignedQuery -> B.ByteString
Expand Down
2 changes: 1 addition & 1 deletion Aws/DynamoDb/Commands/DeleteItem.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ data DeleteItem = DeleteItem {
, diKey :: PrimaryKey
-- ^ The item to delete.
, diExpect :: Conditions
-- ^ (Possible) set of expections for a conditional Put
-- ^ (Possible) set of exceptions for a conditional Put
, diReturn :: UpdateReturn
-- ^ What to return from this query.
, diRetCons :: ReturnConsumption
Expand Down
2 changes: 1 addition & 1 deletion Aws/DynamoDb/Commands/PutItem.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ data PutItem = PutItem {
-- ^ An item to Put. Attributes here will replace what maybe under
-- the key on DDB.
, piExpect :: Conditions
-- ^ (Possible) set of expections for a conditional Put
-- ^ (Possible) set of exceptions for a conditional Put
, piReturn :: UpdateReturn
-- ^ What to return from this query.
, piRetCons :: ReturnConsumption
Expand Down
2 changes: 1 addition & 1 deletion Aws/DynamoDb/Commands/UpdateItem.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ instance ToJSON AttributeUpdates where
--
-- @http:\/\/docs.aws.amazon.com\/amazondynamodb\/latest\/APIReference\/API_UpdateItem.html@
data UpdateAction
= UPut -- ^ Simpley write, overwriting any previous value
= UPut -- ^ Simply write, overwriting any previous value
| UAdd -- ^ Numerical add or add to set.
| UDelete -- ^ Empty value: remove; Set value: Subtract from set.
deriving (Eq,Show,Read,Ord)
Expand Down
2 changes: 1 addition & 1 deletion Aws/Iam/Commands/GetGroup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Data.Text (Text)
import Data.Typeable
import Prelude

-- | Retreives information about the given user.
-- | Retrieves information about the given user.
--
-- If a user name is not given, IAM determines the user name based on the
-- access key signing the request.
Expand Down
2 changes: 1 addition & 1 deletion Aws/Iam/Commands/GetGroupPolicy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import qualified Network.HTTP.Types as HTTP
import Text.XML.Cursor (($//))
import Prelude

-- | Retreives the specified policy document for the specified group.
-- | Retrieves the specified policy document for the specified group.
--
-- <http://docs.aws.amazon.com/IAM/latest/APIReference/API_GetGroupPolicy.html>
data GetGroupPolicy
Expand Down
2 changes: 1 addition & 1 deletion Aws/Iam/Commands/GetUser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Data.Text (Text)
import Data.Typeable
import Prelude

-- | Retreives information about the given user.
-- | Retrieves information about the given user.
--
-- If a user name is not given, IAM determines the user name based on the
-- access key signing the request.
Expand Down
2 changes: 1 addition & 1 deletion Aws/Iam/Commands/GetUserPolicy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import qualified Network.HTTP.Types as HTTP
import Text.XML.Cursor (($//))
import Prelude

-- | Retreives the specified policy document for the specified user.
-- | Retrieves the specified policy document for the specified user.
--
-- <http://docs.aws.amazon.com/IAM/latest/APIReference/API_GetUserPolicy.html>
data GetUserPolicy
Expand Down
8 changes: 4 additions & 4 deletions Aws/Sqs/Commands/Message.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module Aws.Sqs.Commands.Message
, ReceiveMessage(..)
, ReceiveMessageResponse(..)

-- * Change Message Visiblity
-- * Change Message Visibility
, ChangeMessageVisibility(..)
, ChangeMessageVisibilityResponse(..)
) where
Expand Down Expand Up @@ -426,7 +426,7 @@ data ReceiveMessage = ReceiveMessage
-- <http://queue.amazonaws.com/doc/2012-11-05/QueueService.wsdl>
-- all elements except for the attributes are specified as required.
-- At least for the field 'mMD5OfMessageAttributes' the the service
-- is not always returning a value and therefor we make this field optional.
-- is not always returning a value and therefore we make this field optional.
--
data Message = Message
{ mMessageId :: !T.Text
Expand Down Expand Up @@ -508,7 +508,7 @@ readUserMessageAttributeValue cursor = do
return $ UserMessageAttributeBinary c val

(x, _) -> throwM . XmlException
$ "unkown data type for MessageAttributeValue: " <> T.unpack x
$ "unknown data type for MessageAttributeValue: " <> T.unpack x
where
parseType s = case T.break (== '.') s of
(a, "") -> (a, Nothing)
Expand All @@ -519,7 +519,7 @@ readMessage :: Cu.Cursor -> Response SqsMetadata Message
readMessage cursor = do
mid <- force "Missing Message Id"
$ cursor $// Cu.laxElement "MessageId" &/ Cu.content
rh <- force "Missing Reciept Handle"
rh <- force "Missing Receipt Handle"
$ cursor $// Cu.laxElement "ReceiptHandle" &/ Cu.content
md5 <- force "Missing MD5 Signature"
$ cursor $// Cu.laxElement "MD5OfBody" &/ Cu.content
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ NOTE: 0.13 brings breaking changes compared to 0.12.1!
\#72, \#74)
- SES: SendRawEmail now correctly encodes destinations and allows
multiple destinations (\#73)
- EC2: support fo Instance metadata (\#37)
- EC2: support for Instance metadata (\#37)
- Core: queryToHttpRequest allows overriding "Date" for the
benefit of Chris Dornan's Elastic Transcoder bindings (\#77)

Expand Down
2 changes: 1 addition & 1 deletion Examples/Sqs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ main = do
-}
exceptT T.putStrLn T.putStrLn . retryT 4 $ do
qUrls <- liftIO $ do
putStrLn $ "Listing all queueus to check to see if " ++ show (Sqs.qName sqsQName) ++ " is gone"
putStrLn $ "Listing all queues to check to see if " ++ show (Sqs.qName sqsQName) ++ " is gone"
Sqs.ListQueuesResponse qUrls_ <- Aws.simpleAws cfg sqscfg $ Sqs.ListQueues Nothing
mapM_ T.putStrLn qUrls_
return qUrls_
Expand Down
2 changes: 1 addition & 1 deletion tests/DynamoDb/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ withTable
withTable = withTable_ True

withTable_
:: Bool -- ^ whether to prefix te table name
:: Bool -- ^ whether to prefix the table name
-> T.Text -- ^ table Name
-> Int -- ^ read capacity (#(non-consistent) reads * itemsize/4KB)
-> Int -- ^ write capacity (#writes * itemsize/1KB)
Expand Down
2 changes: 1 addition & 1 deletion tests/S3/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ help = L.intercalate "\n"
, "By running the tests in this test-suite costs for usage of AWS"
, "services may incur."
, ""
, "In order to actually excute the tests in this test-suite you must"
, "In order to actually execute the tests in this test-suite you must"
, "provide the command line options:"
, ""
, " --run-with-aws-credentials"
Expand Down
4 changes: 2 additions & 2 deletions tests/Sqs/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ help = L.intercalate "\n"
, "By running the tests in this test-suite costs for usage of AWS"
, "services may incur."
, ""
, "In order to actually excute the tests in this test-suite you must"
, "In order to actually execute the tests in this test-suite you must"
, "provide the command line options:"
, ""
, " --run-with-aws-credentials"
Expand Down Expand Up @@ -297,7 +297,7 @@ prop_sendReceiveDeleteMessageLongPolling queue = do
-- | Checks that long polling is actually enabled. We add a delay to the messages
-- and immediately make a receive request with a polling wait time that is larger
-- than the delay. Note that even though polling forces consistent reads, messages
-- will become available with some (small) offset. Therefor we request only a single
-- will become available with some (small) offset. Therefore we request only a single
-- message at a time.
--
prop_sendReceiveDeleteMessageLongPolling1
Expand Down