Skip to content

Commit

Permalink
Fixed documentation compliance (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser Greenroyd authored Apr 2, 2024
2 parents d12d340 + 1fb1416 commit 28f9f28
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions UI_Engine/Compute/Constructor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public static partial class Compute
/**** Public Methods ****/
/*************************************/

[Input("type", "The type of object to create a constructor for")]
[Input("parameters", "The properties that should be used as parameters for the constructor")]
[Output("constructor", "The compiled constructor")]
[Input("type", "The type of object to create a constructor for.")]
[Input("parameters", "The properties that should be used as parameters for the constructor.")]
[Output("constructor", "The compiled constructor.")]
public static Func<object[], object> Constructor(Type type, List<ParamInfo> parameters)
{
ParameterExpression lambdaInput = Expression.Parameter(typeof(object[]), "x");
Expand Down
8 changes: 4 additions & 4 deletions UI_Engine/Compute/ConstructorText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public static partial class Compute
/**** Public Methods ****/
/*************************************/

[Input("type", "The type of object to create a constructor for")]
[Input("maxParams", "The maximum number of parameters to include in the text")]
[Input("maxChars", "The maximum number of characters for the output text")]
[Output("text", "The text corresponding to the description of the constructor generated for that type")]
[Input("type", "The type of object to create a constructor for.")]
[Input("maxParams", "The maximum number of parameters to include in the text.")]
[Input("maxChars", "The maximum number of characters for the output text.")]
[Output("text", "The text corresponding to the description of the constructor generated for that type.")]
public static string ConstructorText(this Type type, int maxParams = 5, int maxChars = 40)
{
string text = type.Namespace + "." + type.Name + "." + type.Name + "() {";
Expand Down
2 changes: 1 addition & 1 deletion UI_Engine/Compute/SaveSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static partial class Compute
/**** Public Methods ****/
/*************************************/

[Description(@"Saves the settings for a toolkit into C:/ProgramData/BHoM/Settings. If Any previoulsy saved settings for that toolkit will be overwritten")]
[Description(@"Saves the settings for a toolkit into C:/ProgramData/BHoM/Settings. If Any previoulsy saved settings for that toolkit will be overwritten.")]
[Input("settings", "Settings for a toolkit that need to be saved permanently.")]
[Output("success", "Returns true if the settings were saved successfully.")]
public static bool SaveSettings(ISettings settings)
Expand Down
16 changes: 8 additions & 8 deletions UI_Engine/Create/ParamInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public static partial class Create
/**** Public Methods ****/
/*************************************/

[Input("name", "The name of the parameter")]
[Input("type", "The framework type of the parameter, e.g. BH.oM.Base.BHoMObject")]
[Input("kind", "Whether the parameter is an input of an output. Input is the default value")]
[Output("parameter", "The bhom parameter used in the bhom abstract syntax")]
[Input("name", "The name of the parameter.")]
[Input("type", "The framework type of the parameter, e.g. BH.oM.Base.BHoMObject.")]
[Input("kind", "Whether the parameter is an input of an output. Input is the default value.")]
[Output("parameter", "The bhom parameter used in the bhom abstract syntax.")]
public static ParamInfo ParamInfo(string name, Type type = null, ParamKind kind = ParamKind.Input)
{
if (type == null)
Expand All @@ -53,8 +53,8 @@ public static ParamInfo ParamInfo(string name, Type type = null, ParamKind kind

/*************************************/

[Input("property", "The system property to convert to bhom")]
[Output("parameter", "The bhom parameter used in the bhom abstract syntax")]
[Input("property", "The system property to convert to bhom.")]
[Output("parameter", "The bhom parameter used in the bhom abstract syntax.")]
public static ParamInfo ParamInfo(this PropertyInfo property, object instance = null)

Check warning on line 58 in UI_Engine/Create/ParamInfo.cs

View check run for this annotation

BHoMBot-CI / beta-documentation-compliance

UI_Engine/Create/ParamInfo.cs#L58

Input parameter requires a matching Input attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsInputAttributePresent
{
ParamInfo info = new ParamInfo
Expand All @@ -78,8 +78,8 @@ public static ParamInfo ParamInfo(this PropertyInfo property, object instance =

/*************************************/

[Input("property", "The system property to convert to bhom")]
[Output("parameter", "The bhom parameter used in the bhom abstract syntax")]
[Input("parameter", "The system parameter to convert to bhom.")]
[Output("parameter", "The bhom parameter used in the bhom abstract syntax.")]
public static ParamInfo ParamInfo(this ParameterInfo parameter, string description = "")

Check warning on line 83 in UI_Engine/Create/ParamInfo.cs

View check run for this annotation

BHoMBot-CI / beta-documentation-compliance

UI_Engine/Create/ParamInfo.cs#L83

Input parameter requires a matching Input attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsInputAttributePresent
{
Type paramType = parameter.ParameterType;
Expand Down
4 changes: 2 additions & 2 deletions UI_Engine/Query/AreMatching.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static partial class Query
/**** Public Methods ****/
/*************************************/

public static bool AreMatching(List<ParamInfo> newList, List<ParamInfo> oldList)
public static bool AreMatching(this List<ParamInfo> newList, List<ParamInfo> oldList)

Check warning on line 40 in UI_Engine/Query/AreMatching.cs

View check run for this annotation

BHoMBot-CI / beta-documentation-compliance

UI_Engine/Query/AreMatching.cs#L40

Input parameter requires a matching Input attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsInputAttributePresent Input parameter requires a matching Input attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsInputAttributePresent Method must contain an Output or MultiOutput attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/HasOutputAttribute
{
if (newList.Count != oldList.Count)
return false;
Expand All @@ -48,7 +48,7 @@ public static bool AreMatching(List<ParamInfo> newList, List<ParamInfo> oldList)

/*************************************/

public static bool AreMatching(List<PropertyInfo> props, List<ParamInfo> oldList)
public static bool AreMatching(this List<PropertyInfo> props, List<ParamInfo> oldList)

Check warning on line 51 in UI_Engine/Query/AreMatching.cs

View check run for this annotation

BHoMBot-CI / beta-documentation-compliance

UI_Engine/Query/AreMatching.cs#L51

Input parameter requires a matching Input attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsInputAttributePresent Input parameter requires a matching Input attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsInputAttributePresent Method must contain an Output or MultiOutput attribute - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/HasOutputAttribute
{
return oldList.All(x => props.Exists(p => p.Name == x.Name && p.PropertyType == x.DataType));
}
Expand Down
14 changes: 7 additions & 7 deletions UI_Engine/Query/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public static partial class Query
/**** Public Methods ****/
/*************************************/

[Description(@"Extract settings of a given type from C:/ProgramData/BHoM/Settings")]
[Input("type", "Object type of the settings you want to recover")]
[Output("settings", @"Settings recovered from the corresponding file in C:/ProgramData/BHoM/Settings")]
public static ISettings Settings(Type type)
[Description(@"Extract settings of a given type from C:/ProgramData/BHoM/Settings.")]
[Input("type", "Object type of the settings you want to recover.")]
[Output("settings", @"Settings recovered from the corresponding file in C:/ProgramData/BHoM/Settings.")]
public static ISettings Settings(this Type type)
{
if (type == null)
{
Expand All @@ -65,9 +65,9 @@ public static ISettings Settings(Type type)

/*************************************/

[Description(@"Extract settings for a given toolkit from C:/ProgramData/BHoM/Settings")]
[Input("toolkitName", "Toolkit you want to recover the settings for")]
[Output("settings", @"Settings recovered from the corresponding file in C:/ProgramData/BHoM/Settings")]
[Description(@"Extract settings for a given toolkit from C:/ProgramData/BHoM/Settings.")]
[Input("toolkitName", "Toolkit you want to recover the settings for.")]
[Output("settings", @"Settings recovered from the corresponding file in C:/ProgramData/BHoM/Settings.")]
public static ISettings Settings(string toolkitName)
{
// Make sure the file exists
Expand Down

0 comments on commit 28f9f28

Please sign in to comment.