Skip to content

Commit febbe13

Browse files
committed
fix typo and replace to more better word
1 parent 72730e0 commit febbe13

File tree

35 files changed

+145
-112
lines changed

35 files changed

+145
-112
lines changed

.github/workflows/generate-release-target.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Determine the release target tag
3636
id: release-target
3737
run: |
38-
# If workflow is trigged by workflow_dispatch, the value of github.ref_name contains branch ref which workflow runs from.
38+
# If workflow is triggered by workflow_dispatch, the value of github.ref_name contains branch ref which workflow runs from.
3939
# Due to the reason of above, github.event.inputs.release_target_tag_name must be tested before testing github.ref_name.
4040
if [[ -n '${{ github.event.inputs.release_target_tag_name }}' ]]; then
4141
# use dispatched tag name

src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/ApiListWriter.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private void WriteReferencedAssembliesUsingGetReferencedAssemblies()
104104
{
105105
var orderedReferencedAssemblies = assembly
106106
.GetReferencedAssemblies()
107-
.OrderBy(static refassm => refassm.Name, StringComparer.Ordinal);
107+
.OrderBy(static referencedAssembly => referencedAssembly.Name, StringComparer.Ordinal);
108108

109109
foreach (var referencedAssembly in orderedReferencedAssemblies) {
110110
BaseWriter.WriteLine($"// {referencedAssembly.FullName}");
@@ -118,22 +118,22 @@ private unsafe void WriteReferencedAssembliesFromRawMetadata(byte* blobPtr, int
118118
.AssemblyReferences
119119
.Select(reader.GetAssemblyReference)
120120
.ToDictionary(
121-
assmRef => reader.GetString(assmRef.Name),
122-
assmRef => assmRef
121+
assemblyReference => reader.GetString(assemblyReference.Name),
122+
assemblyReference => assemblyReference
123123
);
124124

125-
foreach (var (name, assmRef) in assemblyReferences.OrderBy(static pair => pair.Key, StringComparer.Ordinal)) {
126-
var culture = reader.GetString(assmRef.Culture);
125+
foreach (var (name, assemblyReference) in assemblyReferences.OrderBy(static pair => pair.Key, StringComparer.Ordinal)) {
126+
var culture = reader.GetString(assemblyReference.Culture);
127127

128128
if (string.IsNullOrEmpty(culture))
129129
culture = "neutral";
130130

131-
var publicKeyOrToken = reader.GetBlobBytes(assmRef.PublicKeyOrToken);
131+
var publicKeyOrToken = reader.GetBlobBytes(assemblyReference.PublicKeyOrToken);
132132
var publicKeyOrTokenString = publicKeyOrToken is null || publicKeyOrToken.Length == 0
133133
? string.Empty
134134
: $", PublicKeyToken={string.Concat(publicKeyOrToken.Select(static b => b.ToString("x2", provider: null)))}";
135135

136-
BaseWriter.WriteLine($"// {name}, Version={assmRef.Version}, Culture={culture}{publicKeyOrTokenString}");
136+
BaseWriter.WriteLine($"// {name}, Version={assemblyReference.Version}, Culture={culture}{publicKeyOrTokenString}");
137137
}
138138
}
139139

@@ -307,7 +307,7 @@ options.MemberDeclaration.NullabilityInfoContext is null
307307

308308
private static string GenerateTypeAndMemberDeclarations(
309309
int nestLevel,
310-
Assembly assm,
310+
Assembly assembly,
311311
IEnumerable<Type> types,
312312
ISet<string> referencingNamespaces,
313313
ApiListWriterOptions options,
@@ -359,7 +359,7 @@ options.TypeDeclaration.NullabilityInfoContext is null &&
359359
ret.Append(
360360
GenerateTypeAndMemberDeclarations(
361361
nestLevel,
362-
assm,
362+
assembly,
363363
type,
364364
referencingNamespaces,
365365
options,
@@ -389,7 +389,7 @@ options.TypeDeclaration.NullabilityInfoContext is null &&
389389
// TODO: unsafe types
390390
private static string GenerateTypeAndMemberDeclarations(
391391
int nestLevel,
392-
Assembly assm,
392+
Assembly assembly,
393393
Type t,
394394
ISet<string> referencingNamespaces,
395395
ApiListWriterOptions options,
@@ -414,7 +414,7 @@ private static string GenerateTypeAndMemberDeclarations(
414414

415415
if (
416416
assemblyNameOfTypeForwardedFrom is not null &&
417-
string.Equals(assm.FullName, assemblyNameOfTypeForwardedFrom, StringComparison.Ordinal)
417+
string.Equals(assembly.FullName, assemblyNameOfTypeForwardedFrom, StringComparison.Ordinal)
418418
) {
419419
ret
420420
.Append(indent)
@@ -457,7 +457,7 @@ assemblyNameOfTypeForwardedFrom is not null &&
457457
ret.Append(
458458
GenerateTypeContentDeclarations(
459459
nestLevel + 1,
460-
assm,
460+
assembly,
461461
t,
462462
referencingNamespaces,
463463
options,
@@ -487,7 +487,7 @@ public MemberDeclarationException(string? message, Exception? innerException)
487487

488488
private static string GenerateTypeContentDeclarations(
489489
int nestLevel,
490-
Assembly assm,
490+
Assembly assembly,
491491
Type t,
492492
ISet<string> referencingNamespaces,
493493
ApiListWriterOptions options,
@@ -525,7 +525,7 @@ private static string GenerateTypeContentDeclarations(
525525
ret.Append(
526526
GenerateTypeAndMemberDeclarations(
527527
nestLevel,
528-
assm,
528+
assembly,
529529
nestedTypes.Where(nestedType => !(options.IgnorePrivateOrAssembly && (nestedType.IsNestedPrivate || nestedType.IsNestedAssembly))),
530530
referencingNamespaces,
531531
options,

src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AssemblyExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public static class AssemblyExtensions {
1515
#if NULL_STATE_STATIC_ANALYSIS_ATTRIBUTES
1616
[return: MaybeNull]
1717
#endif
18+
// cSpell:ignore assm
19+
// TODO: change assm -> assembly
1820
public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm)
1921
where TAssemblyMetadataAttribute : Attribute
2022
=> (TValue)GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute>(

src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AssemblyLoader.netcore.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ private static TResult UsingReflectionOnlyAssembly<TArg, TResult>(
7070
assemblySource.ComponentAssemblyPath
7171
);
7272

73-
var assm = assemblySource.File is not null
73+
var assembly = assemblySource.File is not null
7474
? mlc.LoadFromAssemblyPath(assemblySource.File.FullName)
7575
: assemblySource.Stream is not null
7676
? mlc.LoadFromStream(assemblySource.Stream)
7777
: throw new InvalidOperationException($"either {nameof(AssemblySource.File)} or {nameof(AssemblySource.Stream)} must be specified");
7878

79-
if (assm is null) {
79+
if (assembly is null) {
8080
logger?.LogCritical(
8181
"failed to load assembly into reflection-only context (ComponentAssemblyPath: '{ComponentAssemblyPath}')",
8282
assemblySource.ComponentAssemblyPath
@@ -85,11 +85,11 @@ private static TResult UsingReflectionOnlyAssembly<TArg, TResult>(
8585
return default;
8686
}
8787

88-
var assemblyName = assm.FullName;
89-
var assemblyTypeFullName = assm.GetType().FullName;
88+
var assemblyName = assembly.FullName;
89+
var assemblyTypeFullName = assembly.GetType().FullName;
9090

9191
if (!resolver.HasDepsJsonLoaded)
92-
WarnDepsJsonCouldNotBeLoaded(logger, resolver.PossibleAssemblyDepsJsonPath, assm);
92+
WarnDepsJsonCouldNotBeLoaded(logger, resolver.PossibleAssemblyDepsJsonPath, assembly);
9393

9494
logger?.LogDebug(
9595
"loaded reflection-only assembly '{AssemblyName}' ({AssemblyTypeFullName})",
@@ -100,7 +100,7 @@ private static TResult UsingReflectionOnlyAssembly<TArg, TResult>(
100100
if (actionWithLoadedAssembly is null)
101101
return default;
102102

103-
return actionWithLoadedAssembly(assm, arg);
103+
return actionWithLoadedAssembly(assembly, arg);
104104
}
105105

106106
#if NULL_STATE_STATIC_ANALYSIS_ATTRIBUTES
@@ -117,6 +117,7 @@ private static TResult UsingAssembly<TArg, TResult>(
117117
{
118118
context = null;
119119

120+
// cSpell:disable-next-line
120121
var alc = new UnloadableAssemblyLoadContext(assemblySource.ComponentAssemblyPath, logger);
121122
var alcWeakReference = new WeakReference(alc);
122123

@@ -125,13 +126,13 @@ private static TResult UsingAssembly<TArg, TResult>(
125126
assemblySource.ComponentAssemblyPath
126127
);
127128

128-
var assm = assemblySource.File is not null
129+
var assembly = assemblySource.File is not null
129130
? alc.LoadFromAssemblyPath(assemblySource.File.FullName)
130131
: assemblySource.Stream is not null
131132
? alc.LoadFromStream(assemblySource.Stream)
132133
: throw new InvalidOperationException($"either {nameof(AssemblySource.File)} or {nameof(AssemblySource.Stream)} must be specified");
133134

134-
if (assm is null) {
135+
if (assembly is null) {
135136
logger?.LogCritical(
136137
"failed to load assembly (ComponentAssemblyPath: '{ComponentAssemblyPath}')",
137138
assemblySource.ComponentAssemblyPath
@@ -142,11 +143,11 @@ private static TResult UsingAssembly<TArg, TResult>(
142143

143144
context = alcWeakReference;
144145

145-
var assemblyName = assm.FullName;
146-
var assemblyTypeFullName = assm.GetType().FullName;
146+
var assemblyName = assembly.FullName;
147+
var assemblyTypeFullName = assembly.GetType().FullName;
147148

148149
if (!alc.HasDepsJsonLoaded)
149-
WarnDepsJsonCouldNotBeLoaded(logger, alc.PossibleAssemblyDepsJsonPath, assm);
150+
WarnDepsJsonCouldNotBeLoaded(logger, alc.PossibleAssemblyDepsJsonPath, assembly);
150151

151152
logger?.LogDebug(
152153
"loaded assembly '{AssemblyName}' ({AssemblyTypeFullName})",
@@ -158,7 +159,7 @@ private static TResult UsingAssembly<TArg, TResult>(
158159
if (actionWithLoadedAssembly is null)
159160
return default;
160161

161-
return actionWithLoadedAssembly(assm, arg);
162+
return actionWithLoadedAssembly(assembly, arg);
162163
}
163164
finally {
164165
alc.Unload();

src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AssemblyLoader.netframework.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ private static TResult UsingAssemblyCore<TArg, TResult>(
6868

6969
logger?.LogDebug($"loading assembly from file '{assemblyFile.FullName}'");
7070

71-
var assm = proxy.LoadAssembly(assemblyFile);
71+
var assembly = proxy.LoadAssembly(assemblyFile);
7272

73-
if (assm is null) {
73+
if (assembly is null) {
7474
logger?.LogCritical($"failed to load assembly from file '{assemblyFile.FullName}'");
7575

7676
return default;
7777
}
7878

79-
assemblyName = assm.FullName;
79+
assemblyName = assembly.FullName;
8080

8181
logger?.LogDebug($"loaded assembly '{assemblyName}'");
8282

83-
return actionWithLoadedAssembly(assm, arg);
83+
return actionWithLoadedAssembly(assembly, arg);
8484
}
8585
finally {
8686
AppDomain.Unload(domain);

src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/PathAssemblyDependencyResolver.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public PathAssemblyDependencyResolver(string componentAssemblyPath, ILogger? log
3434
{
3535
logger?.LogDebug("attempting to load '{AssemblyName}'", assemblyName);
3636

37-
var assm = base.Resolve(context, assemblyName);
37+
var assembly = base.Resolve(context, assemblyName);
3838

39-
if (assm is not null)
40-
return assm;
39+
if (assembly is not null)
40+
return assembly;
4141

4242
var assemblyPath = dependencyResolver.ResolveAssemblyToPath(assemblyName);
4343

@@ -46,12 +46,12 @@ public PathAssemblyDependencyResolver(string componentAssemblyPath, ILogger? log
4646
return context.LoadFromAssemblyPath(assemblyPath);
4747
}
4848

49-
assm = packageDependencyResolver.Resolve(assemblyName, context.LoadFromAssemblyPath);
49+
assembly = packageDependencyResolver.Resolve(assemblyName, context.LoadFromAssemblyPath);
5050

51-
if (assm is null)
51+
if (assembly is null)
5252
RuntimeAssemblyName.WarnNotToBeAbleToResolve(logger, assemblyName, packageDependencyResolver.DependencyContext);
5353

54-
return assm;
54+
return assembly;
5555
}
5656
}
5757
#endif

src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/UnloadableAssemblyLoadContext.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-FileCopyrightText: 2021 smdn <smdn@smdn.jp>
22
// SPDX-License-Identifier: MIT
3+
// cSpell:ignore unloadable
34
#pragma warning disable CA1848
45

56
#if NETCOREAPP3_1_OR_GREATER
@@ -39,12 +40,12 @@ public UnloadableAssemblyLoadContext(string componentAssemblyPath, ILogger? logg
3940
return LoadFromAssemblyPath(assemblyPath);
4041
}
4142

42-
var assm = packageDependencyResolver.Resolve(name, this.LoadFromAssemblyPath);
43+
var assembly = packageDependencyResolver.Resolve(name, this.LoadFromAssemblyPath);
4344

44-
if (assm is null)
45+
if (assembly is null)
4546
RuntimeAssemblyName.WarnNotToBeAbleToResolve(logger, name, packageDependencyResolver.DependencyContext);
4647

47-
return assm;
48+
return assembly;
4849
}
4950
}
5051
#endif

src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/ReadmeFile.targets

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ SPDX-License-Identifier: MIT
6363
AppDomain
6464
.CurrentDomain
6565
.GetAssemblies()
66-
.First(assm => assm.GetName().Name == item.ItemSpec)
66+
.First(assembly => assembly.GetName().Name == item.ItemSpec)
6767
)
68-
.Select(static assm =>
68+
.Select(static assembly =>
6969
(
70-
Name: assm.GetName().Name,
71-
InformationalVersion: assm.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion,
72-
TargetFramework: assm.GetCustomAttribute<TargetFrameworkAttribute>().FrameworkName
70+
Name: assembly.GetName().Name,
71+
InformationalVersion: assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion,
72+
TargetFramework: assembly.GetCustomAttribute<TargetFrameworkAttribute>().FrameworkName
7373
)
7474
)
7575
.Distinct()

src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/GenerateApiList.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private static void WriteApiListFile(
174174
logger: logger,
175175
context: out var context,
176176
loadIntoReflectionOnlyContext: loadIntoReflectionOnlyContext,
177-
actionWithLoadedAssembly: static (assm, arg) => {
177+
actionWithLoadedAssembly: static (assembly, arg) => {
178178
// ensure the output directory existing
179179
Directory.CreateDirectory(Path.GetDirectoryName(arg.outputApiListFilePath)!);
180180

@@ -196,7 +196,7 @@ private static void WriteApiListFile(
196196
#endif
197197
var writer = new ApiListWriter(
198198
outputWriter,
199-
assm,
199+
assembly,
200200
arg.options,
201201
arg.logger
202202
);

src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/ProjectBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static IEnumerable<FileInfo> Build(
117117
yield return new FileInfo(innerOutputFullPath);
118118
}
119119

120-
// retrieve Build target result / for in cace of building with single target framework
120+
// retrieve Build target result / for in case of building with single target framework
121121
if (result.HasResultsForTarget("Build")) {
122122
var buildTargetResult = result.ResultsByTarget["Build"];
123123

0 commit comments

Comments
 (0)