Skip to content

Commit

Permalink
Spelling fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anpetroc committed Jan 14, 2024
1 parent ecfda93 commit 54df2e4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/PAModel/CanvasDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class CanvasDocument

// Tracks duplicate asset file information. When a name collision happens we generate a new name for the duplicate asset file.
// This dictionary stores the metadata information for that file - like OriginalName, NewFileName, Path...
// Key is a (case-insesitive) new fileName of the resource.
// Key is a (case-insensitive) new fileName of the resource.
// Reason for using FileName of the resource as the key is to avoid name collision across different types eg. Images/close.png, Videos/close.mp4.
internal Dictionary<string, LocalAssetInfoJson> _localAssetInfoJson = new();
internal static string AssetFilePathPrefix = @"Assets\";
Expand Down
2 changes: 1 addition & 1 deletion src/PAModel/Serializers/FileEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal enum FileKind
// If this file is present, it's an older format.
OldEntityJSon,

// Resourcs
// Resources
PublishInfo,

// References
Expand Down
2 changes: 1 addition & 1 deletion src/PAModel/Serializers/MsAppSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public static CanvasDocument Load(Stream streamToMsapp, ErrorContainer errors)
}
}

// Only for data-compoents.
// Only for data-components.
if (dctemplate?.ComponentTemplates != null)
{
var order = 0;
Expand Down
30 changes: 15 additions & 15 deletions src/PAModel/Serializers/SourceSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static CanvasDocument LoadFromSource(string directory2, ErrorContainer er

var dir = new DirectoryReader(directory2);
var app = new CanvasDocument();
string appInsightsInstumentationKey = null;
string appInsightsInstrumentationKey = null;

// Do the manifest check (and version check) first.
// MAnifest lives in top-level directory.
Expand Down Expand Up @@ -128,7 +128,7 @@ public static CanvasDocument LoadFromSource(string directory2, ErrorContainer er
break;
case FileKind.AppInsightsKey:
var appInsights = file.ToObject<AppInsightsKeyJson>();
appInsightsInstumentationKey = appInsights.InstrumentationKey;
appInsightsInstrumentationKey = appInsights.InstrumentationKey;
break;
}
}
Expand All @@ -145,9 +145,9 @@ public static CanvasDocument LoadFromSource(string directory2, ErrorContainer er
}


if (appInsightsInstumentationKey != null)
if (appInsightsInstrumentationKey != null)
{
app._properties.InstrumentationKey = appInsightsInstumentationKey;
app._properties.InstrumentationKey = appInsightsInstrumentationKey;
}
if (app._header == null)
{
Expand Down Expand Up @@ -206,7 +206,7 @@ public static CanvasDocument LoadFromSource(string directory2, ErrorContainer er
app._resourcesJson.Resources = resources.ToArray();
}

// We have processed all the json files in Assets directory, now interate through all the files to add the asset files.
// We have processed all the json files in Assets directory, now iterate through all the files to add the asset files.
foreach (var file in dir.EnumerateFiles(AssetsDir))
{
// Skip adding the json files which were created to contain the information for duplicate asset files.
Expand All @@ -230,7 +230,7 @@ public static CanvasDocument LoadFromSource(string directory2, ErrorContainer er

app.GetLogoFile();

// Add the entries for local assets back to resrouces.json
// Add the entries for local assets back to resources.json
TransformResourceJson.AddLocalAssetEntriesToResourceJson(app);

foreach (var file in dir.EnumerateFiles(OtherDir))
Expand Down Expand Up @@ -345,11 +345,11 @@ private static void LoadPcfControlTemplateFiles(ErrorContainer errors, CanvasDoc
}
}

private static void LoadCustomPagesSchemaMetadata(CanvasDocument app, string custompagesMetadataPath)
private static void LoadCustomPagesSchemaMetadata(CanvasDocument app, string customPagesMetadataPath)
{
if (File.Exists(custompagesMetadataPath))
if (File.Exists(customPagesMetadataPath))
{
var file = new DirectoryReader.Entry(custompagesMetadataPath);
var file = new DirectoryReader.Entry(customPagesMetadataPath);
app._customPageInputsMetadata = file.GetContents();
}
}
Expand Down Expand Up @@ -484,7 +484,7 @@ private static void AddControl(CanvasDocument app, string filePath, bool isCompo
return; // error condition
}

// validate that all the packages refferred are not accidentally deleted from pkgs dierectory
// validate that all the packages referred are not accidentally deleted from pkgs directory
ValidateIfTemplateExists(app, controlIR, controlIR, errors);

// Since the TestSuites are sharded into individual files make sure to add them as children of AppTest control
Expand Down Expand Up @@ -622,7 +622,7 @@ public static void SaveAsSource(CanvasDocument app, string directory2, ErrorCont
// Loose files.
foreach (var file in app._unknownFiles.Values)
{
// Standardize the .json files so they're determinsitc and comparable
// Standardize the .json files so they're deterministic and comparable
if (file.Name.HasExtension(".json"))
{
ReadOnlyMemory<byte> span = file.RawBytes;
Expand Down Expand Up @@ -679,7 +679,7 @@ private static void WriteDataSources(DirectoryWriter dir, CanvasDocument app, Er
foreach (var kvp in app.GetDataSources())
{
// Filename doesn't actually matter, but careful to avoid collisions and overwriting.
// Also be determinstic.
// Also be deterministic.
var filename = kvp.Key + ".json";

if (!filenames.Add(filename.ToLower()))
Expand Down Expand Up @@ -718,7 +718,7 @@ private static void WriteDataSources(DirectoryWriter dir, CanvasDocument app, Er
{
if (ds.ApiId == "/providers/microsoft.powerapps/apis/shared_commondataservice")
{
// This is the old CDS connector, we can't support it since it's optionset format is incompatable with the newer one
// This is the old CDS connector, we can't support it since it's optionset format is incompatible with the newer one
errors.UnsupportedError($"Connection {ds.Name} is using the old CDS connector which is incompatible with this tool");
throw new DocumentException();
}
Expand Down Expand Up @@ -763,7 +763,7 @@ private static void WriteDataSources(DirectoryWriter dir, CanvasDocument app, Er
var referenceJson = app._dataSourceReferences[dataSourceDef.DatasetName];
untrackedLdr.Remove(dataSourceDef.DatasetName);

// copy over the localconnectionreference
// copy over the local connection reference
if (referenceJson.dataSources?.TryGetValue(dataSourceDef.EntityName, out var dsRef) ?? false)
{
dataSourceDef.LocalReferenceDSJson = dsRef;
Expand Down Expand Up @@ -876,7 +876,7 @@ private static void LoadDataSources(CanvasDocument app, DirectoryReader director
{
// Generate an error, dataset defs have diverged in a way that shouldn't be possible
// Each dataset has one instanceurl
errors.ValidationError($"For file {file._relativeName}, the dataset {tableDef.DatasetName} has multiple instanceurls");
errors.ValidationError($"For file {file._relativeName}, the dataset {tableDef.DatasetName} has multiple instance URLs");
throw new DocumentException();
}

Expand Down
1 change: 0 additions & 1 deletion src/PAModel/SourceTransforms/ComponentInstanceTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public ComponentInstanceTransform(ErrorContainer errors)
_errors = errors;
}


public IEnumerable<string> TargetTemplates => ComponentRenames.Keys;

public void AfterRead(BlockNode control)
Expand Down
2 changes: 1 addition & 1 deletion src/PAModel/Themes/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.PowerPlatform.Formulas.Tools;
// Encapsulate the ThemeJson.
internal class Theme
{
// Outer key is stylename, inner key is property name, inner value is expression
// Outer key is style name, inner key is property name, inner value is expression
private readonly Dictionary<string, Dictionary<string, string>> _styles = new(StringComparer.OrdinalIgnoreCase);

public Theme(ThemesJson themeJson)
Expand Down
4 changes: 2 additions & 2 deletions src/PAModel/Utility/ControlPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public ControlPath Next()

public ControlPath Append(string controlName)
{
var newpath = new List<string>(_segments)
var newPath = new List<string>(_segments)
{
controlName
};
return new ControlPath(newpath);
return new ControlPath(newPath);
}

public ControlPath(List<string> segments)
Expand Down
8 changes: 4 additions & 4 deletions src/PAModel/Utility/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static byte[] ToBytes(this ZipArchiveEntry e)
}

// JsonElement is loss-less, handles unknown fields without dropping them.
// Convertering to a Poco drops fields we don't recognize.
// Converting to a Poco drops fields we don't recognize.
public static JsonElement ToJson(this ZipArchiveEntry e)
{
using (var s = e.Open())
Expand Down Expand Up @@ -198,9 +198,9 @@ public static string GetRelativePath(string relativeTo, string fullPathFile)
relativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
}

// If there was any replacement chracter (black diamond with a white heart) in the original string, it gets encoded to %EF%BF%BD
// If there was any replacement character (black diamond with a white heart) in the original string, it gets encoded to %EF%BF%BD
// see details here: http://www.cogsci.ed.ac.uk/~richard/utf-8.cgi?input=%EF%BF%BD&mode=char
// spcial handling to add replacement character back to the original string
// special handling to add replacement character back to the original string
relativePath = relativePath.Replace("%EF%BF%BD", "");

return relativePath;
Expand Down Expand Up @@ -420,7 +420,7 @@ private static string TruncateName(string name, int length)

/// <summary>
/// djb2 algorithm to compute the hash of a string
/// This must be determinstic and stable since it's used in file names
/// This must be deterministic and stable since it's used in file names
/// </summary>
/// <param name="str">The string for which we need to compute the hash.</param>
/// <returns></returns>
Expand Down

0 comments on commit 54df2e4

Please sign in to comment.