Skip to content
Permalink
Browse files

Merge pull request #2220 from transcom/cg_fix_mdspell_pre_commit

Re-enable spelling pre-commit hook
  • Loading branch information...
chrisgilmerproj committed Jun 4, 2019
2 parents b2afb0d + 332be57 commit b7eac91e2e5e14cd9b59c869b81c8f61b6b3ebda
@@ -86,19 +86,19 @@ repos:
files: go.mod
pass_filenames: false

# - repo: local
# hooks:
# - id: mdspell
# name: mdspell
# entry: scripts/pre-commit-spellcheck
# language: script
# files: \.md$
# exclude: >
# (?x)^(
# node_modules/|
# vendor/|
# docs/adr/index.md
# )$
- repo: local
hooks:
- id: mdspell
name: mdspell
entry: scripts/pre-commit-spellcheck
language: script
files: \.md$
exclude: >
(?x)^(
node_modules/|
vendor/|
docs/adr/index.md
)$
- repo: local
hooks:
@@ -417,6 +417,64 @@ csh
_Prevention_Cheat_Sheet#Double_Submit_Cookie
IT-19
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.
- /usr/local
- docs/data/tspp-data-creation.md
@@ -428,6 +486,7 @@ IT-18
- ./docs/frontend.md
_Regenerate
- ./README.md
transportation_service_provider_performances
transportation_service_provider_performances
- ./docs/data/tspp-data-creation.md
- ./docs/data/tariff400ng-yearly-import.md
- ./scripts/README.md
@@ -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
and an Engineer wants to filter by foreign key.
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,
they also weren't built in a way that can be easily extended.
@@ -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
[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

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

## Pros and Cons of the Alternatives

@@ -71,7 +71,7 @@ the name of the service object execution method.

**Parameters**
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.
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
@@ -98,7 +98,7 @@ type FormCreator interface {

**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.
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*

@@ -9,7 +9,7 @@
5. `tariff400ng_shorthaul_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).
2. Look under “Special Requirements and Rates Team” -> “Domestic” -> “400NG Baseline Rates” and download yearly rate file.
@@ -55,7 +55,7 @@
* [2018 data load](https://github.com/transcom/mymove/pull/382)
* [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.
3. Remember to drop the function in the migration.

@@ -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)

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

@@ -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)

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

@@ -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.
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.
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**.
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.
@@ -25,7 +25,7 @@ committing.
| --- | --- |
| gen-docs-index | generate index for documents |
| 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-go-imports | modify imports in go files |
| pre-commit-go-lint | modify go files with linting rules |
@@ -66,11 +66,11 @@ application testing
| Script Name | Description |
| --- | --- |
| 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 |
| 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. |
| 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. |
| make-test | A script to test common developer make targets. |

0 comments on commit b7eac91

Please sign in to comment.
You can’t perform that action at this time.