Skip to content

Commit

Permalink
Merge pull request #2220 from transcom/cg_fix_mdspell_pre_commit
Browse files Browse the repository at this point in the history
Re-enable spelling pre-commit hook
  • Loading branch information
Chris Gilmer committed Jun 4, 2019
2 parents b2afb0d + 332be57 commit b7eac91
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 27 deletions.
26 changes: 13 additions & 13 deletions .pre-commit-config.yaml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ repos:
files: go.mod files: go.mod
pass_filenames: false pass_filenames: false


# - repo: local - repo: local
# hooks: hooks:
# - id: mdspell - id: mdspell
# name: mdspell name: mdspell
# entry: scripts/pre-commit-spellcheck entry: scripts/pre-commit-spellcheck
# language: script language: script
# files: \.md$ files: \.md$
# exclude: > exclude: >
# (?x)^( (?x)^(
# node_modules/| node_modules/|
# vendor/| vendor/|
# docs/adr/index.md docs/adr/index.md
# )$ )$
- repo: local - repo: local
hooks: hooks:
Expand Down
61 changes: 60 additions & 1 deletion .spelling
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -417,6 +417,64 @@ csh
_Prevention_Cheat_Sheet#Double_Submit_Cookie _Prevention_Cheat_Sheet#Double_Submit_Cookie
IT-19 IT-19
IT-18 IT-18
utils
facebookgo
clock.mock
testyear
util
createform
ppp-infra
trailing-whitespace
whitespace
markdownlint
validator
dps
markdown-toc
goimports
golangci-lint
unreferenced
golint
govet
printf
gosec
gofmt
varcheck
typecheck
structcheck
deadcode
stylesheets
stylesheet
timestamps
tariff400ng
dp3
move.mil
waterhaul
milmove
adminlocal
goland
check-gopath
pre-commit-circleci-validate
circleci-announce-broken-branch
circleci-push-dependency-updates
ecs-deploy-service-container
ecs-restart-services
ecs-run-app-migrations-container
rds-snapshot-app-db
triaging
ecs-show-service-logs
ecs-show-service-stopped-logs
export-obfuscated-tspp-sample
copy-swagger-ui
Stanger
www.ustranscom.mil
hhg.cfm
xxx.html
goqu
toolset
metadata
pre-commit-codecov-validate
codecov
hoc
# Put all custom terms BEFORE this comment, lest you end up in an mdspell pain cycle. # Put all custom terms BEFORE this comment, lest you end up in an mdspell pain cycle.
- /usr/local - /usr/local
- docs/data/tspp-data-creation.md - docs/data/tspp-data-creation.md
Expand All @@ -428,6 +486,7 @@ IT-18
- ./docs/frontend.md - ./docs/frontend.md
_Regenerate _Regenerate
- ./README.md - ./README.md
transportation_service_provider_performances
transportation_service_provider_performances transportation_service_provider_performances
- ./docs/data/tspp-data-creation.md - ./docs/data/tspp-data-creation.md
- ./docs/data/tariff400ng-yearly-import.md
- ./scripts/README.md
6 changes: 3 additions & 3 deletions docs/adr/0035-use-query-builder.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ they may want to view all shipments created or updated recently.
Maybe the bug seems to be related to a certain set of moves Maybe the bug seems to be related to a certain set of moves
and an Engineer wants to filter by foreign key. and an Engineer wants to filter by foreign key.
This type of exploratory querying isn't built into the current APIs This type of exploratory querying isn't built into the current APIs
because it's not relevent or authorized to users of the production applications. because it's not relevant or authorized to users of the production applications.


Since the current apps don't require this capability, Since the current apps don't require this capability,
they also weren't built in a way that can be easily extended. they also weren't built in a way that can be easily extended.
Expand Down Expand Up @@ -227,7 +227,7 @@ In this case, the API uses a generic filter parameter, such as:
Note that we're going to run into object nesting issues discussed in this Note that we're going to run into object nesting issues discussed in this
[Open API Spec Issue](https://github.com/OAI/OpenAPI-Specification/issues/1706) [Open API Spec Issue](https://github.com/OAI/OpenAPI-Specification/issues/1706)


The handler (or middleware) marshalls those filters into a `QueryFilter` The handler (or middleware) marshals those filters into a `QueryFilter`
and passes them to the service and passes them to the service


## Decision Outcome ## Decision Outcome
Expand All @@ -236,7 +236,7 @@ and passes them to the service
* The main motivators of this decision are: * The main motivators of this decision are:
* It accomplishes our desired feature set * It accomplishes our desired feature set
* It is relatively simple to implement * It is relatively simple to implement
* It makes our codebase more maintainble * It makes our codebase more maintainable


## Pros and Cons of the Alternatives ## Pros and Cons of the Alternatives


Expand Down
4 changes: 2 additions & 2 deletions docs/backend/service-objects.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ the name of the service object execution method.


**Parameters** **Parameters**
Remember that service objects should be reusable. Try to abstract as much out of the logic specific parameters to achieve this. Remember that service objects should be reusable. Try to abstract as much out of the logic specific parameters to achieve this.
Pass as many parameters as make sense. Use your best judgement. In the following example from the codebase, we are only passing in one parameter to the `CreateForm` execution method, a Pass as many parameters as make sense. Use your best judgment. In the following example from the codebase, we are only passing in one parameter to the `CreateForm` execution method, a
`template` variable with the type `FormTemplate`. This is because the `FormTemplate` is more complex than most service objects and this use case works for use here. `template` variable with the type `FormTemplate`. This is because the `FormTemplate` is more complex than most service objects and this use case works for use here.
Some service objects will only require only one or two parameters and a struct is not appropriate.`FormTemplate` only holds relatively abstract parameters such that the service Some service objects will only require only one or two parameters and a struct is not appropriate.`FormTemplate` only holds relatively abstract parameters such that the service
object can be reused if needed. Regarding `CreateForm`, this service object can be reused to generate another PDF by passing object can be reused if needed. Regarding `CreateForm`, this service object can be reused to generate another PDF by passing
Expand All @@ -98,7 +98,7 @@ type FormCreator interface {


**Return Values** **Return Values**
Service objects should return as many return values as appropriate. In the case of a service object like the CreateForm, the first parameter is whatever the service object is responsible for creating. If the first parameter returns a created entity, the second parameter should be an error. Service objects should return as many return values as appropriate. In the case of a service object like the CreateForm, the first parameter is whatever the service object is responsible for creating. If the first parameter returns a created entity, the second parameter should be an error.
In the case of a simple entity fetch by ID, the first parameter could be model validation errors. There are some situations that require more complex returns. For those, use your best judgement. In the case of a simple entity fetch by ID, the first parameter could be model validation errors. There are some situations that require more complex returns. For those, use your best judgment.


*Remember all `errors` should be Wrapped by using `errors.Wrap` so that the underlying error is propagated properly* *Remember all `errors` should be Wrapped by using `errors.Wrap` so that the underlying error is propagated properly*


Expand Down
8 changes: 4 additions & 4 deletions docs/data/tariff400ng-yearly-import.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
5. `tariff400ng_shorthaul_rates` 5. `tariff400ng_shorthaul_rates`
6. `tariff400ng_item_rates` 6. `tariff400ng_item_rates`


## Obtain yearly rates `xlsx` file from ustranscom ## Obtain yearly rates `xlsx` file from USTRANSCOM


1. Visit: [https://www.ustranscom.mil/dp3/hhg.cfm](https://www.ustranscom.mil/dp3/hhg.cfm) (for some reason, I had to load hit this url twice... the first visit redirected to another page). 1. Visit: [https://www.ustranscom.mil/dp3/hhg.cfm](https://www.ustranscom.mil/dp3/hhg.cfm) (for some reason, I had to load hit this url twice... the first visit redirected to another page).
2. Look under “Special Requirements and Rates Team” -> “Domestic” -> “400NG Baseline Rates” and download yearly rate file. 2. Look under “Special Requirements and Rates Team” -> “Domestic” -> “400NG Baseline Rates” and download yearly rate file.
Expand Down Expand Up @@ -55,7 +55,7 @@
* [2018 data load](https://github.com/transcom/mymove/pull/382) * [2018 data load](https://github.com/transcom/mymove/pull/382)
* [2019 data load](https://github.com/transcom/mymove/pull/2036) * [2019 data load](https://github.com/transcom/mymove/pull/2036)


1. Create a function that will take values and update the corrisponding columns in the `tariff400ng_service_areas`. (see pr for details) 1. Create a function that will take values and update the corresponding columns in the `tariff400ng_service_areas`. (see pr for details)
2. Transform rates into cents add for each row, transform row into form `SELECT update_sit_rates('service_area', sit_185a, sit_185b, sit_pd_schedule);` for each row. 2. Transform rates into cents add for each row, transform row into form `SELECT update_sit_rates('service_area', sit_185a, sit_185b, sit_pd_schedule);` for each row.
3. Remember to drop the function in the migration. 3. Remember to drop the function in the migration.


Expand Down Expand Up @@ -84,7 +84,7 @@ We're going to make use of the work that Patrick Stanger delivered in [this PR](
* [2019 data load](https://github.com/transcom/mymove/pull/2036) * [2019 data load](https://github.com/transcom/mymove/pull/2036)


1. Create migration to load `insert` statements generated from the sheet above. 1. Create migration to load `insert` statements generated from the sheet above.
2. Replace `ID_HERE` with `uuid_generate_v4()` to generate a uuid. 2. Replace `ID_HERE` with `uuid_generate_v4()` to generate a UUID.


### Fix certain item rates. Update `weight_lbs_lower` and update `rate_cents` for specific codes ### Fix certain item rates. Update `weight_lbs_lower` and update `rate_cents` for specific codes


Expand All @@ -94,7 +94,7 @@ We're going to make use of the work that Patrick Stanger delivered in [this PR](
* [2019 data load](https://github.com/transcom/mymove/pull/2060) * [2019 data load](https://github.com/transcom/mymove/pull/2060)


1. Create migration to modify `weight_lbs_lower` and `rate_cents` (see pr for example). 1. Create migration to modify `weight_lbs_lower` and `rate_cents` (see pr for example).
Note - This step could be addressed when origionally tranforming the data in the `xlsx`. Note - This step could be addressed when originally transforming the data in the `xlsx`.


## Spot check for correct data ## Spot check for correct data


Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/migrate-the-database.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ We are piggy-backing on the migration system for importing static datasets. This
3. Copy the production migration into the local test migration. 3. Copy the production migration into the local test migration.
4. Scrub the test migration of sensitive data, but use it to test the gist of the production migration operation. 4. Scrub the test migration of sensitive data, but use it to test the gist of the production migration operation.
5. Test the local migration by running `make db_dev_migrate`. You should see it run your local migration. 5. Test the local migration by running `make db_dev_migrate`. You should see it run your local migration.
6. Test the secure migration by running `make run_prod_migrations` to setup a local prod_migrations` database. Then run `psql-prod-migrations< tmp/$NAME_OF_YOUR_SECURE_MIGRATION`. Verify that the updated values are in the database. 6. Test the secure migration by running `make run_prod_migrations` to setup a local `prod_migrations` database. Then run `psql-prod-migrations< tmp/$NAME_OF_YOUR_SECURE_MIGRATION`. Verify that the updated values are in the database.
7. If you are wanting to run a secure migration for a specific non-production environment, then **skip to the next section**. 7. If you are wanting to run a secure migration for a specific non-production environment, then **skip to the next section**.
8. Upload the migration to S3 with: `upload-secure-migration <production_migration_file>`. **NOTE:** For a single environment see the next section. 8. Upload the migration to S3 with: `upload-secure-migration <production_migration_file>`. **NOTE:** For a single environment see the next section.
9. Run `make run_prod_migrations` to verify that the upload worked and that the migration can be applied successfully. If not, you can make changes and run `upload-secure-migration` again and it will overwrite the old files. 9. Run `make run_prod_migrations` to verify that the upload worked and that the migration can be applied successfully. If not, you can make changes and run `upload-secure-migration` again and it will overwrite the old files.
Expand Down
6 changes: 3 additions & 3 deletions scripts/README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ committing.
| --- | --- | | --- | --- |
| gen-docs-index | generate index for documents | | gen-docs-index | generate index for documents |
| generate-md-toc | Wrapper script to generate table of contents on Markdown files. | | generate-md-toc | Wrapper script to generate table of contents on Markdown files. |
| pre-commit-circleci-validate | validate circleci `config.yml` file | | pre-commit-circleci-validate | validate CircleCI `config.yml` file |
| pre-commit-codecov-validate | validate codecov `.codecov.yml` file | | pre-commit-codecov-validate | validate codecov `.codecov.yml` file |
| pre-commit-go-imports | modify imports in go files | | pre-commit-go-imports | modify imports in go files |
| pre-commit-go-lint | modify go files with linting rules | | pre-commit-go-lint | modify go files with linting rules |
Expand Down Expand Up @@ -66,11 +66,11 @@ application testing
| Script Name | Description | | Script Name | Description |
| --- | --- | | --- | --- |
| dump-function-calls | Show all used functions in our codebase. | | dump-function-calls | Show all used functions in our codebase. |
| dump-packages | Show all used packges in our codebase. | | dump-packages | Show all used packages in our codebase. |
| export-obfuscated-tspp-sample | Export a subset of rows from the transportation_service_provider_performances table | | export-obfuscated-tspp-sample | Export a subset of rows from the transportation_service_provider_performances table |
| find-invoices | This script will use available API endpoints to find invoices in whatever environment you specify| | find-invoices | This script will use available API endpoints to find invoices in whatever environment you specify|
| generate-devlocal-cert | Convenience script for creating a new certificate signed by the devlocal CA. | | generate-devlocal-cert | Convenience script for creating a new certificate signed by the devlocal CA. |
| go-find-pattern | searchs over all our go source code files for a regex pattern | | go-find-pattern | searches over all our go source code files for a regex pattern |
| merge-pr | A script to automate the landing of your GitHub pull requests. | | merge-pr | A script to automate the landing of your GitHub pull requests. |
| make-test | A script to test common developer make targets. | | make-test | A script to test common developer make targets. |


Expand Down

0 comments on commit b7eac91

Please sign in to comment.