Skip to content

Commit

Permalink
Merge pull request #303 from opentripplanner/enforce-codespell
Browse files Browse the repository at this point in the history
Correct spelling errors and enforce codespell
  • Loading branch information
binh-dam-ibigroup authored Jan 7, 2021
2 parents 50c4a32 + 1d9e31d commit e70730a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ jobs:
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
only_warn: 1
skip: ./.git,yarn.lock
2 changes: 1 addition & 1 deletion lib/actions/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export function carRentalQuery (params) {
return createQueryAction('car_rental', carRentalResponse, carRentalError)
}

// Vehicle rental locations lookup query. For now, there are 3 seperate
// Vehicle rental locations lookup query. For now, there are 3 separate
// "vehicle" rental endpoints - 1 for cars, 1 for bicycle rentals and another
// for micromobility. In the future, the hope is to consolidate these 3
// endpoints into one.
Expand Down
4 changes: 2 additions & 2 deletions lib/actions/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function fetchAuth0Token (auth0) {

dispatch(setCurrentUser({ accessToken }))
} catch (error) {
// TODO: improve UI if there is an errror.
// TODO: improve UI if there is an error.
alert('Error obtaining an authorization token.')
}
}
Expand Down Expand Up @@ -257,7 +257,7 @@ export function requestPhoneVerificationSms (newPhoneNumber) {
const now = new Date()

// Request a new verification code if we are requesting a different number.
// or enough time has ellapsed since the last request (1 minute?).
// or enough time has elapsed since the last request (1 minute?).
// TODO: Should throttling be handled in the middleware?
if (number !== newPhoneNumber || (now - timestamp) >= 60000) {
const { accessToken, apiBaseUrl, apiKey, loggedInUser } = getMiddlewareVariables(state)
Expand Down
4 changes: 2 additions & 2 deletions lib/components/user/notification-prefs-pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const allowedNotificationChannels = [
]

// Styles
// HACK: Preverve container height.
// HACK: Preserve container height.
const Details = styled.div`
min-height: 150px;
margin-bottom: 15px;
Expand Down Expand Up @@ -132,7 +132,7 @@ const NotificationPrefsPane = ({
bsStyle={notificationChannel === type ? 'primary' : 'default'}
key={index}
// onBlur and onChange have to be set on individual controls instead of the control group
// in order for Formik to correcly process the changes.
// in order for Formik to correctly process the changes.
onBlur={handleBlur}
onChange={handleChange}
value={type}
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export {
TripDetails,
TripTools,

// mobile compoments
// mobile components
MobileMain,

// viewer components
Expand Down
10 changes: 5 additions & 5 deletions lib/reducers/create-otp-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const MAX_RECENT_STORAGE = 5
* Validates the initial state of the store. This is intended to mainly catch
* configuration issues since a manually edited config file is loaded into the
* initial state.
* TODO: mabye it's a better idea to move all of this to a script that can do
* TODO: maybe it's a better idea to move all of this to a script that can do
* JSON Schema validation and other stuff.
*/
function validateInitalState (initialState) {
function validateInitialState (initialState) {
const {config} = initialState

const errors = []
Expand Down Expand Up @@ -237,8 +237,8 @@ export function getInitialState (userDefinedConfig, initialQuery) {

function createOtpReducer (config, initialQuery) {
const initialState = getInitialState(config, initialQuery)
// validate the inital state
validateInitalState(initialState)
// validate the initial state
validateInitialState(initialState)

return (state = initialState, action) => {
const searchId = action.payload && action.payload.searchId
Expand Down Expand Up @@ -560,7 +560,7 @@ function createOtpReducer (config, initialQuery) {
if (duplicateIndex !== -1) searches[duplicateIndex] = action.payload
else searches.unshift(action.payload)
const sortedSearches = searches.sort((a, b) => b.timestamp - a.timestamp)
// Ensure recent searches do not extend beyong MAX_RECENT_STORAGE
// Ensure recent searches do not extend beyond MAX_RECENT_STORAGE
if (sortedSearches.length >= MAX_RECENT_STORAGE) {
sortedSearches.splice(MAX_RECENT_STORAGE)
}
Expand Down

0 comments on commit e70730a

Please sign in to comment.