Skip to content

Commit

Permalink
Merge pull request #2033 from moreal/ci/gh-actions/check-typos
Browse files Browse the repository at this point in the history
  • Loading branch information
moreal authored Jul 27, 2023
2 parents a45946a + 2986395 commit 7f95253
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: lint

on: [push, pull_request]

jobs:
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check typos
uses: crate-ci/typos@v1.15.5
2 changes: 1 addition & 1 deletion Lib9c.Policy/Policy/IVariableSubPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public interface IVariableSubPolicy<T>
/// to check.</param>
/// <returns><c>true</c> if <paramref name="index"/> is target for any
/// <see cref="SpannedSubPolicy{T}"/> in <see cref="SpannedSubPolicies"/>. Otherwise,
/// <c>fase</c>.</returns>
/// <c>false</c>.</returns>
/// <remarks>
/// Call to this method must only be used <em>sparingly</em> and should be <em>avoided</em>
/// if possible. Usage of this method indicates dependency coupling between two
Expand Down
4 changes: 2 additions & 2 deletions Lib9c/Action/EventMaterialItemCrafts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public override IAccountStateDelta Execute(IActionContext context)
var materialItemSheet = states.GetSheet<MaterialItemSheet>();
if (!materialItemSheet.TryGetValue(
recipeRow.ResultMaterialItemId,
out var resulMaterialRow))
out var resultMaterialRow))
{
throw new SheetRowNotFoundException(
addressesHex,
Expand Down Expand Up @@ -228,7 +228,7 @@ public override IAccountStateDelta Execute(IActionContext context)
// ~Remove Required Materials

// Create Material
var materialResult = ItemFactory.CreateMaterial(resulMaterialRow);
var materialResult = ItemFactory.CreateMaterial(resultMaterialRow);
avatarState.inventory.AddItem(materialResult, recipeRow.ResultMaterialItemCount);
// ~Create Material

Expand Down
4 changes: 2 additions & 2 deletions Lib9c/Action/ValidatorSetOperate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public override void LoadPlainValue(IValue plainValue)

Operator = op;
// FIXME: This is a temporary code for backward compatibility.
Operand = BackwardCompability(operandDict);
Operand = BackwardCompatibility(operandDict);
Error = null;
}

Expand All @@ -172,7 +172,7 @@ protected override void LoadPlainValueInternal(IImmutableDictionary<string, IVal
$"The serialized dictionary lacks the key \"{nameof(ValidatorSetOperateKey)}\".";
}

private Validator BackwardCompability(Bencodex.Types.Dictionary dict)
private Validator BackwardCompatibility(Bencodex.Types.Dictionary dict)
{
try
{
Expand Down
19 changes: 19 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[default]
extend-ignore-re = [
"\\\"([a-zA-Z0-9][a-zA-Z0-9])+\\\"", # for hexadecimal string values.
"2nd"
]

[default.extend-identifiers]
fo = "fo" # FungibleOrder

[default.extend-words]
ba = "ba" # byte array
oce = "oce" # OperationCanceledException
ist = "ist" # ItemSubType
Equipments = "Equipments" # FIXME: Equipment is noncount word but our team doesn't have the policy about it.

[files]
extend-exclude = [
".Libplanet/*"
]

0 comments on commit 7f95253

Please sign in to comment.