Skip to content

Commit abdfd05

Browse files
authored
Periodic spellcheck (#2612)
* cspell exception updates Signed-off-by: michael sorens <[email protected]> * Add spellcheck to authz and ui makefiles Signed-off-by: michael sorens <[email protected]> * Spelling corrections Signed-off-by: michael sorens <[email protected]> * UI spelling fixes Signed-off-by: michael sorens <[email protected]> * Customization for automate-chef-io Migrated file selection recently added to automate-chef-io/Makefile Signed-off-by: michael sorens <[email protected]> * Revert "Add spellcheck to authz and ui makefiles" This reverts commit 7660429. Moving to common makefile instead. * Add common spell target to makefiles Signed-off-by: michael sorens <[email protected]> * Remove exception for contraction Signed-off-by: michael sorens <[email protected]> * Revise and comment local spellcheck This one components uses a custom spellchec as well; renaming it and commenting just for clarity. Signed-off-by: michael sorens <[email protected]> * Couple more catches Signed-off-by: michael sorens <[email protected]>
1 parent d908f02 commit abdfd05

File tree

43 files changed

+149
-70
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+149
-70
lines changed

.studiorc

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ else
2020
fi
2121

2222
# Install busybox-static so script evaluations (e.g. #!/bin/bash) will work
23-
# This ensures normal linxu studios work like Docker studios
23+
# This ensures normal linux studios work like Docker studios
2424
log_line "Install busybox-static & bash hart packages"
2525
hab pkg install core/busybox-static >/dev/null
2626
hab pkg binlink -d /bin core/busybox-static >/dev/null

Makefile.common_go

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# components/xyz-service/Makefile
33
REPOROOT?=../..
44

5+
# Convert, e.g., "src/github.com/chef/automate/components/teams-service" to "components/teams-service"
6+
REPO_DIR := $(shell cd $(REPOROOT) && pwd)/
7+
COMPONENT_DIR := $(shell echo $${PWD\#"$(REPO_DIR)"})
8+
59
LIBRARY_PATH = github.com/chef/automate/lib
610

711
UNAME_S:=$(shell uname -s)
@@ -37,4 +41,11 @@ fmt:
3741
fmt-check:
3842
@test -z $(shell gofmt -l ./cmd/ ./pkg/)
3943

44+
spell:
45+
@pushd $(REPOROOT) > /dev/null; \
46+
./scripts/spellcheck.sh --wordsOnly $(COMPONENT_DIR); \
47+
EXIT_CODE=$$?; \
48+
popd > /dev/null; \
49+
exit $$EXIT_CODE
50+
4051
.PHONY: lint fmt fmt-check golang_version_check

components/applications-service/cmd/applications-publisher/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func main() {
143143
)
144144

145145
// In habitat, the wrappers.StringValue for stdout and stderr will be nil
146-
// pointers when there's no content (e.g., a package without a healhcheck
146+
// pointers when there's no content (e.g., a package without a healthcheck
147147
// command/script). To mimic that behavior we need to initialize the
148148
// optionalString variables here with nil pointers for their StringValue
149149
// elements.

components/authn-service/tokens/pg/pg_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ func TestPurgeProject(t *testing.T) {
595595
assert.NoError(err, "failed to get token")
596596
assert.ElementsMatch([]string{"otherproject", "otherproject2"}, purgeCheck.Projects)
597597
},
598-
"when there are mulitple tokens, some with, some without the project to purge": func(t *testing.T) {
598+
"when there are multiple tokens, some with, some without the project to purge": func(t *testing.T) {
599599
id1 := "other_projects"
600600
projects1 := []string{"otherproject", "otherproject2"}
601601
resp1, err := store.CreateToken(ctx, id1, description, true, projects1)

components/authz-service/engine/opa/opa_v2_internal_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ func BenchmarkAuthorizedProjectsIncreasingMembershipFrequency(b *testing.B) {
731731
}
732732
}
733733

734-
// A: more frequest membership means slower authorization times (but not by much)
734+
// A: more frequent membership means slower authorization times (but not by much)
735735
// BenchmarkAuthorizedProjectsIncreasingMembershipFrequency/store_with_0_policies_that_include_the_subject_as_a_member-8 179049 8298 ns/op 3193 B/op 83 allocs/op
736736
// BenchmarkAuthorizedProjectsIncreasingMembershipFrequency/store_with_1_out_of_10_policies_that_include_the_subject_as_a_member-8 140113 10122 ns/op 3304 B/op 86 allocs/op
737737
// BenchmarkAuthorizedProjectsIncreasingMembershipFrequency/store_with_2_out_of_10_policies_that_include_the_subject_as_a_member-8 135043 11135 ns/op 3304 B/op 86 allocs/op
@@ -831,7 +831,7 @@ func v2BaselineAndRandomPoliciesAndRoles(customPolicyCount int, customRoleCount
831831
}
832832

833833
for _, id := range customPolicyIDs {
834-
// generate btwn range 1..10 statements
834+
// generate between range 1..10 statements
835835
// 10 is an arbitrary max
836836
statementCount := rand.Intn(10-1) + 1
837837

@@ -884,7 +884,7 @@ func v2BaselineAndRandomPoliciesAndRoles(customPolicyCount int, customRoleCount
884884
}
885885
}
886886

887-
// generate btwn range 1..total number of members
887+
// generate between range 1..total number of members
888888
memberCount := rand.Intn((len(members) - 1) + 1)
889889

890890
// shuffle the array of possible members,

components/automate-chef-io/Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ build: themes/chef generate_swagger
5454
hugo
5555

5656
# Consult scripts/spellcheck.sh in the root Automate directory for notes on using cspell.
57-
spellcheck:
57+
# This does files in automate-chef-io plus exposed proto files.
58+
# Alternately, you can use the common `make spell` to skip the proto files.
59+
spell_all:
5860
@pushd ../.. > /dev/null && \
5961
cspell \
6062
"api/external/**/*.proto" \

components/automate-deployment/pkg/backup/builder_operations.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func (d *BuilderMinioDumpOperation) copyObjectFromBuilder(backupCtx Context, bac
227227
return writer.Close()
228228
}
229229

230-
// copyObjectFromBackup copiesl data from the backup bucket to the
230+
// copyObjectFromBackup copies data from the backup bucket to the
231231
// automate-builder-minio bucket.
232232
func (d *BuilderMinioDumpOperation) copyObjectFromBackup(backupCtx Context, backupPrefix string, obj string, objVerifier ObjectVerifier) error {
233233
ctx := backupCtx.ctx

components/automate-deployment/pkg/converge/converger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func (w *waitingForRestart) ProcessMessage(_ *converger, msg message) (state, bo
421421

422422
func (w *waitingForRestart) String() string { return "waiting for restart" }
423423

424-
// waitingForReconfigure is a converer state that we enter whenever we
424+
// waitingForReconfigure is a converger state that we enter whenever we
425425
// expect to have received a reconfiguration request from the Habitat
426426
// supervisor.
427427
type waitingForReconfigure struct {

components/automate-deployment/pkg/habpkg/semverish.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func CompareSemverish(a SemverishVersion, b SemverishVersion) int {
108108
return SemverishLess
109109
}
110110

111-
// Otherwise, just lexigraphically sort the pre-release, this
111+
// Otherwise, just lexicographically sort the pre-release, this
112112
// is not what the spec says to do.
113113
if a.prerelease < b.prerelease {
114114
return SemverishLess

components/automate-deployment/pkg/habpkg/semverish_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ func TestSemverCompare(t *testing.T) {
106106
}
107107
}
108108

109-
func BenchmarkParseSemverishVerionBasic(b *testing.B) {
109+
func BenchmarkParseSemverishVersionBasic(b *testing.B) {
110110
v := "1.2.3"
111111
for n := 0; n < b.N; n++ {
112112
ParseSemverishVersion(v)
113113
}
114114
}
115115

116-
func BenchmarkParseSemverishVerionAll(b *testing.B) {
116+
func BenchmarkParseSemverishVersionAll(b *testing.B) {
117117
l := len(semverTests)
118118
for n := 0; n < b.N; n++ {
119119
ParseSemverishVersion(semverTests[n%l].input)

components/automate-deployment/pkg/manifest/client/http.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var packagesChefIOKeyRing openpgp.EntityList
6262
func init() {
6363
entityList, err := openpgp.ReadArmoredKeyRing(strings.NewReader(packagesChefIOSigAsc))
6464
if err != nil {
65-
panic(errors.Wrap(err, "Failed to read pacakges.chef.io public key"))
65+
panic(errors.Wrap(err, "Failed to read packages.chef.io public key"))
6666
}
6767
packagesChefIOKeyRing = entityList
6868
}

components/automate-deployment/pkg/server/startup_helpers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func habSupVersion() string {
3939
}
4040

4141
// maybeResetHabPath adds the bindir from our manifest's hab package
42-
// to our PATH. This is a developent-mode only operation to account
42+
// to our PATH. This is a development-mode only operation to account
4343
// for test cases where we want to deploy with the latest Habitat.
4444
func maybeResetHabPath(s *server) {
4545
if os.Getenv("CHEF_DEV_ENVIRONMENT") != "true" {

components/automate-deployment/pkg/target/local_target.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ func (t *LocalTarget) HabSupRestart(ctx context.Context, sortedServiceList []str
743743
// shuts down services with a TERM followed (after 8 seconds) by a
744744
// KILL. We would like to avoid the KILL being sent to our data
745745
// services. Shutting down services in their reverse startup order
746-
// makes it more liely that data services will shut down quickly since
746+
// makes it more likely that data services will shut down quickly since
747747
// all of their clients have been stopped.
748748
func (t *LocalTarget) SystemdRestart(ctx context.Context, sortedServiceList []string) (bool, error) {
749749
habSupP, err := t.habSup.SupPkg()

components/automate-gateway/gateway/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func (s *Server) Serve() error {
421421
// `rpc Export(Query) returns (stream ExportData) {};`
422422
mux.HandleFunc("/compliance/reporting/export", s.ReportExportHandler)
423423

424-
// custome mux route for export of all reports for a single node
424+
// custom mux route for export of all reports for a single node
425425
mux.HandleFunc("/compliance/reporting/node/export", s.NodeExportHandler)
426426

427427
// custom mux route for export (ignores its request method)

components/automate-gateway/integration/data_lifecycle_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (suite *GatewayTestSuite) TestDataLifecycleConfigure() {
197197
}
198198

199199
// TestDataLifecycleRun ensures that when "run" is called that we actually run
200-
// data lifecycle jobs on the backend. Each invidual service already has
200+
// data lifecycle jobs on the backend. Each individual service already has
201201
// integrations tests for their data lifecycle jobs so we only need to test
202202
// if the jobs are being triggered successfully. The purge jobs record their
203203
// start and end times in the database so we can use the timestamps to determine

components/automate-openjdk/habitat/plan.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#shellcheck disable=SC2154
33

44
# Instead of wrapping the core/openjdk11 package, we're using our own so that
5-
# we don't need to depend on ALSA or FreeType, which have non-comaptible licenses.
5+
# we don't need to depend on ALSA or FreeType, which have non-compatible licenses.
66

77
pkg_origin=chef
88
pkg_maintainer="Chef Software Inc. <[email protected]>"

components/automate-ui/docs/css_scss_and_styling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* [Flexbox](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes)
1313
* Small sample of reusable components currently available in the `/component` library
1414

15-
## CSS dont
15+
## CSS don't
1616

1717
* `!important`s should NOT be used
1818
* comments disabling the linter should and will be reviewed with extreme skepticism

components/automate-ui/src/app/entities/layout/layout-sidebar.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class LayoutSidebarService {
7171
}];
7272
}
7373

74-
public getInfastructureSidebar(): MenuItemGroup[] {
74+
public getInfrastructureSidebar(): MenuItemGroup[] {
7575
return [{
7676
name: 'Infrastructure',
7777
items: [

components/automate-ui/src/app/entities/layout/layout.facade.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ export class LayoutFacadeService {
8282
));
8383
}
8484

85-
showInfastructureSidebar(): void {
85+
showInfrastructureSidebar(): void {
8686
this.store.dispatch(new UpdateSidebarMenuGroups(
87-
this.layoutSidebarService.getInfastructureSidebar()
87+
this.layoutSidebarService.getInfrastructureSidebar()
8888
));
8989
}
9090

components/automate-ui/src/app/page-components/search-bar/search-bar.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ describe('SearchBarComponent', () => {
392392
component.handleInput('enter', 'chef-?-nodes');
393393
});
394394

395-
it('catagory does not allow wildcards', () => {
395+
it('category does not allow wildcards', () => {
396396
jasmine.clock().uninstall();
397397
jasmine.clock().install();
398398
component.selectedCategoryType = component.categories[0];

components/automate-ui/src/app/pages/+compliance/+reporting/+reporting-overview/reporting-overview.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('ReportingOverviewComponent', () => {
7878
spyOn(router, 'navigate');
7979
spyOn(console, 'warn');
8080

81-
component.onDateChanged('lkjasdl');
81+
component.onDateChanged('not-a-date');
8282

8383
expect(router.navigate).not.toHaveBeenCalled();
8484
});

components/automate-ui/src/app/pages/+compliance/+reporting/reporting.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ describe('ReportingComponent', () => {
382382
);
383383
});
384384

385-
it('parse invaild interval 1', () => {
385+
it('parse invalid interval 1', () => {
386386
spyOn(reportQueryService, 'setState');
387387
const endDate = moment().utc().startOf('day').add(12, 'hours');
388388
const interval = 0;
@@ -405,7 +405,7 @@ describe('ReportingComponent', () => {
405405
);
406406
});
407407

408-
it('parse invaild interval 2', () => {
408+
it('parse invalid interval 2', () => {
409409
spyOn(reportQueryService, 'setState');
410410
const endDate = moment().utc().startOf('day').add(12, 'hours');
411411
const interval = 0;

components/automate-ui/src/app/pages/client-runs/client-runs.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export class ClientRunsComponent implements OnInit, OnDestroy {
252252
) { }
253253

254254
ngOnInit() {
255-
this.layoutFacade.showInfastructureSidebar();
255+
this.layoutFacade.showInfrastructureSidebar();
256256
// Only load when first opening the /chef-runs page
257257
this.store.dispatch(new GetWorkflowEnabled());
258258

components/automate-ui/src/app/pages/data-feed/data-feed.component.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
</chef-page-header>
1212

1313
<div class="page-body">
14-
<chef-alert type="error" *ngIf="errorLoading">There was an error loading destiantions.</chef-alert>
15-
14+
<chef-alert type="error" *ngIf="errorLoading">There was an error loading destinations.</chef-alert>
15+
1616
<chef-toolbar>
17-
17+
1818
<app-authorized [anyOf]="['/datafeed/destination', 'post']">
1919
<div *ngIf="(destinations$ | async)?.length === 0" class="empty-state">
2020
<p>Create the first datafeed endpoint to get started!</p>
@@ -23,9 +23,9 @@
2323
<chef-button primary [routerLink]="['/settings/data-feed/form']">Create Destination</chef-button>
2424
</div>
2525
</app-authorized>
26-
26+
2727
</chef-toolbar>
28-
28+
2929
<app-authorized [anyOf]="['/datafeed/destinations', 'post']">
3030
<chef-table *ngIf="(destinations$ | async)?.length > 0" id="destinations-list">
3131
<chef-tr>
@@ -48,18 +48,18 @@
4848
</chef-td>
4949
</chef-tr>
5050
</chef-table>
51-
51+
5252
</app-authorized>
53-
54-
53+
54+
5555
<app-page-picker
5656
[total]="(destinations$ | async)?.length"
5757
[perPage]="pageSize"
5858
[page]="currentPage"
5959
(pageChanged)="currentPage = $event">
6060
</app-page-picker>
61-
61+
6262
</div><!--page-body-->
6363
</main>
6464
</div><!--destinations-container-->
65-
</div>
65+
</div>

components/automate-ui/src/app/pages/node-details/node-details.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class NodeDetailsComponent implements OnInit, OnDestroy {
3838
}
3939

4040
ngOnInit() {
41-
this.layoutFacade.showInfastructureSidebar();
41+
this.layoutFacade.showInfrastructureSidebar();
4242
// Scroll to the top of the view
4343
window.scrollTo(0, 0);
4444
this.nodeId = this.getRouteParam('node-id');

components/automate-ui/src/app/pages/node-noruns-details/node-noruns-details.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class NodeNoRunsDetailsComponent implements OnInit {
2020
) {}
2121

2222
ngOnInit() {
23-
this.layoutFacade.showInfastructureSidebar();
23+
this.layoutFacade.showInfrastructureSidebar();
2424
this.nodeId = this.getRouteParam('node-id');
2525
this.route.data.subscribe((data: { node: Node }) => {
2626
this.node = data.node;

components/automate-ui/src/app/pages/service-groups/service-groups.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class ServiceGroupsComponent implements OnInit, OnDestroy {
4646
public serviceGroupsError$: Observable<HttpErrorResponse>;
4747
public sgHealthSummary: ServiceGroupsHealthSummary;
4848

49-
// Selected sarch bar filters
49+
// Selected search bar filters
5050
public selectedSearchBarFilters = [];
5151

5252
// The selected service-group id that will be sent to the services-sidebar
@@ -244,7 +244,7 @@ export class ServiceGroupsComponent implements OnInit, OnDestroy {
244244
// selected service group. However, this logic does not apply to the
245245
// *service* status filters (in the services sidebar); when all services
246246
// are filtered out via those status filters we have a special state that
247-
// says, e.g., "none of the services reuturned warning" that we want to
247+
// says, e.g., "none of the services returned warning" that we want to
248248
// show.
249249
this.store.select(serviceGroupsStatus).subscribe((sgStatus) => {
250250
if (sgStatus === 'loadingSuccess') {

components/automate-workflow-ctl/lib/ctl-helpers/ohai.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def self.ohai
2323
# Simplifies resetting the cached ohai for testing purposes.
2424
def self.reset!
2525
remove_class_variable(:@@ohai) if class_variable_defined?(:@@ohai)
26-
# Dont' return the value of old @@ohai
26+
# Don't return the value of old @@ohai
2727
nil
2828
end
2929
end

components/compliance-service/api/reporting/server/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (srv *Server) ListProfiles(ctx context.Context, in *reporting.Query) (*repo
163163
return &profileMins, nil
164164
}
165165

166-
// ListControlItems returns a list of contolListItems based on query
166+
// ListControlItems returns a list of controlListItems based on query
167167
func (srv *Server) ListControlItems(ctx context.Context, in *reporting.ControlItemRequest) (*reporting.ControlItems, error) {
168168
var controlListItems *reporting.ControlItems
169169
if in.Size == 0 {

components/compliance-service/compliance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ func setupDataLifecyclePurgeInterface(ctx context.Context, connFactory *secureco
402402

403403
// Migrate default policy values from the config. The default policies are
404404
// only persisted the first time the workflow is created, after which only
405-
// new default policies are added and/or existing policies indicies are
405+
// new default policies are added and/or existing policies indices are
406406
// updated in case they have been migrated.
407407

408408
for i, p := range defaultPurgePolicies.Es {

components/compliance-service/scanner/db.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (s *Scanner) UpdateParentJobSchedule(jobId string, jobCount int32, recurren
285285
// Parsing the recurrence RRULE
286286
r, err := rrule.StrToRRule(recurrence)
287287
if err != nil {
288-
return errors.Wrapf(err, "UpdateParentJobSchedule unablee to parse recurrence string")
288+
return errors.Wrapf(err, "UpdateParentJobSchedule unable to parse recurrence string")
289289
}
290290

291291
nowTimeUtc := time.Now().UTC()

components/data-feed-service/service/data-feed-poll-task.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (d *DataFeedPollTask) getFeedEndTime(feedInterval time.Duration, now time.T
150150
return feedEndTime
151151
}
152152

153-
// GetChangedNodes calls the nodes API to get any nodes whch have had a client run during the interval
153+
// GetChangedNodes calls the nodes API to get any nodes which have had a client run during the interval
154154
// Returns a map of ipaddress to NodeIDs struct
155155
func (d *DataFeedPollTask) GetChangedNodes(ctx context.Context, pageSize int32, feedStartTime time.Time, feedEndTime time.Time) (map[string]NodeIDs, error) {
156156
log.Debugf("Inventory nodes start %v, %v, %v", pageSize, feedStartTime, feedEndTime)

0 commit comments

Comments
 (0)