From a83e5762297f1e750fa004021c97c3ffbbb5107a Mon Sep 17 00:00:00 2001 From: Gas One Cent <86567384+gas1cent@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:18:24 +0400 Subject: [PATCH] docs: missing documentation --- src/main.ts | 2 +- src/utils.ts | 10 +++++++--- src/validator.ts | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index 6cf710c..646e49c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,7 +39,7 @@ import { Validator } from './validator'; /** * Parses the command line arguments and returns the configuration - * @returns {Config} + * @returns {Config} The config object */ function getArguments(): Config { return yargs(hideBin(process.argv)) diff --git a/src/utils.ts b/src/utils.ts index 6322533..f2fc3cd 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -16,7 +16,7 @@ export async function getSolidityFilesAbsolutePaths(files: string[]): Promise { // Fetch Solidity files from the specified directory @@ -41,7 +41,7 @@ export async function getProjectCompiledSources(rootPath: string, includedPaths: * Checks if the file path is in the specified directory * @param {string} directory - The directory path * @param {string} filePath - The file path - * @returns + * @returns {boolean} - True if the file is in the directory */ export function isFileInDirectory(directory: string, filePath: string): boolean { // Convert both paths to absolute and normalize them @@ -107,8 +107,12 @@ export async function getRemappingsFromConfig(foundryConfigPath: string): Promis } } +/** + * Makes sure both sides of a remapping either have or don't have a trailing slash + * @param {string} line - A line from the remappings array + * @returns {string} - The sanitized line + */ export function sanitizeRemapping(line: string): string { - // Make sure the key and the value both either have or don't have a trailing slash const [key, value] = line.split('='); const slashNeeded = key.endsWith('/'); diff --git a/src/validator.ts b/src/validator.ts index b326f3a..22589df 100644 --- a/src/validator.ts +++ b/src/validator.ts @@ -123,8 +123,8 @@ export class Validator { /** * Validates the natspec for return parameters. * All returned parameters should have natspec - * @param {FunctionDefinition} node - * @param {(string | undefined)[]} natspecReturns + * @param {FunctionDefinition} node - The function node + * @param {(string | undefined)[]} natspecReturns - The list of `return` tags from the natspec * @returns {string[]} - The list of alerts */ private validateReturnParameters(node: FunctionDefinition, natspecReturns: (string | undefined)[]): string[] {