Skip to content

Commit

Permalink
build(lint): start using cspell for grammar in code
Browse files Browse the repository at this point in the history
Utilsing cSpell to prevent common spelling mistakes in code.

This is implemented as part of the npm lint script, which gets executed both
on a commit and during the CI pipeline.

Signed-off-by: Travis Payne <travis.payne@accenture.com>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
Travis Payne authored and petermetz committed May 25, 2021
1 parent b4be654 commit 26b4261
Show file tree
Hide file tree
Showing 92 changed files with 736 additions and 248 deletions.
82 changes: 82 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"version": "0.1",
"language": "en",
"minWordLength": 4,
"allowCompoundWords": true,
"words": [
"Besu",
"Corda",
"HyperLedger",
"DockerOde",
"Keychain",
"Keycloak",
"Cordapp",
"Healthcheck",
"uuidv",
"Xdai",
"OpenAPI",
"Errorf",
"Oidc",
"Authz",
"Bools",
"Secp",
"openethereum",
"NODETXPOOLACK",
"LEDGERBLOCKACK",
"GETHKEYCHAINPASSWORD",
"NETWORKSCOPEALLFORTX",
"tlsca",
"grpc",
"grpcs",
"MSPCONFIGPATH",
"LOCALMSPID",
"organisation",
"notok",
"txqueue",
"tlscacerts",
"dclm",
"SPDX",
"mychannel",
"gopath",
"myvolume",
"authzn",
"supervisord",
"ipaddress",
"MSPIDSCOPEALLFORTX",
"ANYFORTX",
"MSPIDSCOPEALLFORTX",
"NETWORKSCOPEANYFORTX",
"MSPIDSCOPEANYFORTX",
"MSPID",
"ALLFORTX",
"cccs",
"svcs",
"vscc",
"escc",
"faio",
"hashicorp",
"cafile",
"supervisorctl",
"onsi",
"Mtls",
"APIV",
"Nerc",
"ccid",
"adminpw",
"caio",
"protos",
"Unmarshal",
"myroot",
"ealen",
"approveformyorg",
"jboss",
"Sprintf"
],
"dictionaries": [
"typescript,node,npm,go"
],
"ignorePaths": [
"node_modules/**",
"**/build/**"
]
}
2 changes: 1 addition & 1 deletion .devcontainer/library-scripts/common-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
fi

# Adapted, simplified inline Oh My Zsh! install steps that adds, defaults to a codespaces theme.
# See https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh for offical script.
# See https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh for official script.
OH_MY_INSTALL_DIR="${USER_RC_PATH}/.oh-my-zsh"
if [ ! -d "${OH_MY_INSTALL_DIR}" ] && [ "${INSTALL_OH_MYS}" = "true" ]; then
TEMPLATE_PATH="${OH_MY_INSTALL_DIR}/templates/zshrc.zsh-template"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export class CarbonAccountingAppDummyInfrastructure {
this.log.info(`Deploying ${contractName}...`);

const timelockAccount = await this.xdai.createEthTestAccount(2000000);
const dclm8Accunt = await this.xdai.createEthTestAccount(2000000);
const dclm8Account = await this.xdai.createEthTestAccount(2000000);
const guardianAccount = await this.xdai.createEthTestAccount(2000000);
const res = await besuPlugin.deployContract({
contractName,
Expand All @@ -420,7 +420,7 @@ export class CarbonAccountingAppDummyInfrastructure {
// address timelock_, address dclm8_, address guardian_
constructorArgs: [
timelockAccount.address,
dclm8Accunt.address,
dclm8Account.address,
guardianAccount.address,
],
gas: 8000000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const log = LoggerProvider.getOrCreate({

test("BEFORE " + testCase, async (t: Test) => {
const pruning = pruneDockerAllIfGithubAction({ logLevel });
await t.doesNotReject(pruning, "Pruning didnt throw OK");
await t.doesNotReject(pruning, "Pruning didn't throw OK");
t.end();
});

Expand Down Expand Up @@ -163,6 +163,6 @@ test(testCase, async (t: Test) => {

test("AFTER " + testCase, async (t: Test) => {
const pruning = pruneDockerAllIfGithubAction({ logLevel });
await t.doesNotReject(pruning, "Pruning didnt throw OK");
await t.doesNotReject(pruning, "Pruning didn't throw OK");
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class EmissionsChaincode {
args: string[],
): Promise<ChaincodeResponse> {
logger.info(`importUtilityIdentifier method called with args : ${args}`);
// uuid is required for importing utility identifer
// uuid is required for importing utility identifier
if (args.length < 1) {
logger.error(
`${ErrInvalidNumberOfArgument} : importUtilityIdentifier method requires at-least 1 argument, but got ${args.length}`,
Expand Down Expand Up @@ -469,7 +469,7 @@ class EmissionsChaincode {
args: string[],
): Promise<ChaincodeResponse> {
logger.info(`updateUtilityIdentifier method called with args : ${args}`);
// uuid is required for importing utility identifer
// uuid is required for importing utility identifier
if (args.length < 1) {
logger.error(
`${ErrInvalidNumberOfArgument} : updateUtilityIdentifier method requires at-least 1 argument, but got ${args.length}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { QueryResult, WorldState } from "../util/worldstate";
import { getYearFromDate } from "./emissions-calc";
import { UtilityLookupItemInterface } from "./utilityLookupItem";

const UTILITY_EMISSIONS_FACTOR_CLASS_IDENTIFER =
const UTILITY_EMISSIONS_FACTOR_CLASS_IDENTIFIER =
"org.hyperledger.blockchain-carbon-accounting.utilityemissionsfactoritem";

export interface UtilityEmissionsFactorInterface {
Expand Down Expand Up @@ -47,7 +47,7 @@ export class UtilityEmissionsFactor extends State {
_factor.division_id,
]);
this.factor = _factor;
this.factor.class = UTILITY_EMISSIONS_FACTOR_CLASS_IDENTIFER;
this.factor.class = UTILITY_EMISSIONS_FACTOR_CLASS_IDENTIFIER;
this.factor.key = this.getKey();
}
toBuffer(): Uint8Array {
Expand Down Expand Up @@ -97,7 +97,7 @@ export class UtilityEmissionsFactorState extends WorldState<
queryString = `{
"selector" : {
"class": {
"$eq": "${UTILITY_EMISSIONS_FACTOR_CLASS_IDENTIFER}"
"$eq": "${UTILITY_EMISSIONS_FACTOR_CLASS_IDENTIFIER}"
},
"division_id" : {
"$eq": "${divisionID}"
Expand All @@ -114,7 +114,7 @@ export class UtilityEmissionsFactorState extends WorldState<
queryString = `{
"selector" : {
"class": {
"$eq": "${UTILITY_EMISSIONS_FACTOR_CLASS_IDENTIFER}"
"$eq": "${UTILITY_EMISSIONS_FACTOR_CLASS_IDENTIFIER}"
},
"division_id" : {
"$eq": "${divisionID}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.3",
"info": {
"title": "Hyperledger Cactus Example - Carbon Accounting App",
"description": "Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.",
"description": "Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.",
"version": "0.2.0",
"license": {
"name": "Apache 2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface ICarbonAccountingPluginOptions {
fabricApiClient: FabricApi;
fabricPlugin: PluginLedgerConnectorFabric;
web3SigningCredential?: Web3SigningCredential;
fabricEnviroment?: NodeJS.ProcessEnv;
fabricEnvironment?: NodeJS.ProcessEnv;
fabricContracts: ICarbonAccountingFabricContractDeploymentInfo;
xdaiContracts: ICarbonAccountingXdaiContractDeploymentInfo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Hyperledger Cactus Example - Carbon Accounting App
* Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.
* Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
*
* The version of the OpenAPI document: 0.2.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Hyperledger Cactus Example - Carbon Accounting App
* Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.
* Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
*
* The version of the OpenAPI document: 0.2.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Hyperledger Cactus Example - Carbon Accounting App
* Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.
* Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
*
* The version of the OpenAPI document: 0.2.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Hyperledger Cactus Example - Carbon Accounting App
* Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.
* Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
*
* The version of the OpenAPI document: 0.2.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Checkpoint } from "../../generated/openapi/typescript-axios";

/**
* Responsible for converting model entities such as the `Checkpoint` to and
* from the different represenatations it can exist in such as a generic JS
* from the different representations it can exist in such as a generic JS
* object with key/value pair properties or when being returned as an array of
* values by a Solidity smart contract for example where the indicies of the
* values by a Solidity smart contract for example where the indices of the
* array can be mapped to the field names.
*/
export class CheckpointConverter {
Expand All @@ -13,7 +13,7 @@ export class CheckpointConverter {

/**
* Converts a `Checkpoint` model entity from an array representation (
* usually returned by a solidity contract function) to a POJO.
* usually returned by a solidity contract function) to a Plain Old Java Object.
*
* @param arr The array containing the values of properties describing a
* `Checkpoint` model entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class SupplyChainApp {
besuApiClient,
quorumApiClient,
fabricApiClient,
fabricEnviroment: org1Env,
fabricEnvironment: org1Env,
}),
new PluginKeychainMemory({
instanceId: uuidv4(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.3",
"info": {
"title": "Hyperledger Cactus Example - Supply Chain App",
"description": "Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.",
"description": "Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.",
"version": "0.2.0",
"license": {
"name": "Apache 2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface ISupplyChainCactusPluginOptions {
besuApiClient: BesuApi;
fabricApiClient: FabricApi;
web3SigningCredential?: Web3SigningCredential;
fabricEnviroment?: NodeJS.ProcessEnv;
fabricEnvironment?: NodeJS.ProcessEnv;
contracts: ISupplyChainContractDeploymentInfo;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Hyperledger Cactus Example - Supply Chain App
* Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.
* Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
*
* The version of the OpenAPI document: 0.2.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Hyperledger Cactus Example - Supply Chain App
* Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.
* Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
*
* The version of the OpenAPI document: 0.2.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Hyperledger Cactus Example - Supply Chain App
* Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.
* Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
*
* The version of the OpenAPI document: 0.2.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Hyperledger Cactus Example - Supply Chain App
* Demonstrates how a business use case can be satisifedwith Cactus when multiple distinct ledgers are involved.
* Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.
*
* The version of the OpenAPI document: 0.2.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { BambooHarvest } from "../../generated/openapi/typescript-axios";

/**
* Responsible for converting model entities such as the `BambooHarvest` to and
* from the different represenatations it can exist in such as a generic JS
* from the different representations it can exist in such as a generic JS
* object with key/value pair properties or when being returned as an array of
* values by a Solidity smart contract for example where the indicies of the
* values by a Solidity smart contract for example where the indices of the
* array can be mapped to the field names.
*/
export class BambooHarvestConverter {
Expand All @@ -16,7 +16,7 @@ export class BambooHarvestConverter {

/**
* Converts a `BambooHarvest` model entity from an array representation (
* usually returned by a solidity contract function) to a POJO.
* usually returned by a solidity contract function) to a Plain Old Java Object.
*
* @param arr The array containing the values of properties describing a
* `BambooHarvest` model entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Bookshelf } from "../../generated/openapi/typescript-axios/index";

/**
* Responsible for converting model entities such as the `Bookshelf` to and
* from the different represenatations it can exist in such as a generic JS
* from the different representations it can exist in such as a generic JS
* object with key/value pair properties or when being returned as an array of
* values by a Solidity smart contract for example where the indicies of the
* values by a Solidity smart contract for example where the indices of the
* array can be mapped to the field names.
*/
export class BookshelfConverter {
Expand All @@ -14,7 +14,7 @@ export class BookshelfConverter {

/**
* Converts a `Bookshelf` model entity from an array representation (
* usually returned by a solidity contract function) to a POJO.
* usually returned by a solidity contract function) to a Plain Old Java Object.
*
* @param arr The array containing the values of properties describing a
* `Bookshelf` model entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class BambooHarvestDetailPage implements OnInit {
this.bambooHarvest = {
id: uuidv4(),
harvester: "Captain Lumberjack Logging Corporation",
location: "Pīpīwai Trail, Hana, HI 96713, United States",
location: "London, NW1 2DB, United Kingdom",
startedAt: new Date(2020, 6, 10, 7, 0, 0, 0).toJSON(),
endedAt: new Date(2020, 6, 10, 16, 0, 0, 0).toJSON(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class BambooHarvestListPage implements OnInit {

public get supplyChainApi(): SupplyChainApi {
if (!this._supplyChainApi) {
throw new Error(`InvalidStateError: _supplyChainApi not initialzied.`);
throw new Error(`InvalidStateError: _supplyChainApi not initialized.`);
} else {
return this._supplyChainApi;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class BookshelfDetailPage implements OnInit {

public get supplyChainApi(): SupplyChainApi {
if (!this._supplyChainApi) {
throw new Error(`InvalidStateError: _supplyChainApi not initialzied.`);
throw new Error(`InvalidStateError: _supplyChainApi not initialized.`);
} else {
return this._supplyChainApi;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class BookshelfListPage implements OnInit {

public get supplyChainApi(): SupplyChainApi {
if (!this._supplyChainApi) {
throw new Error(`InvalidStateError: _supplyChainApi not initialzied.`);
throw new Error(`InvalidStateError: _supplyChainApi not initialized.`);
} else {
return this._supplyChainApi;
}
Expand Down
Loading

0 comments on commit 26b4261

Please sign in to comment.