Skip to content

Commit

Permalink
docs: missing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Feb 20, 2024
1 parent 8b7c7b2 commit a83e576
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
10 changes: 7 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function getSolidityFilesAbsolutePaths(files: string[]): Promise<st
* Returns the list of source units of the compiled Solidity files
* @param {string} rootPath - The root path of the project
* @param {string[]} includedPaths - The list of included paths
* @returns
* @returns {SourceUnit[]} - The list of source units extracted from the compiled files
*/
export async function getProjectCompiledSources(rootPath: string, includedPaths: string[]): Promise<SourceUnit[]> {
// Fetch Solidity files from the specified directory
Expand All @@ -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
Expand Down Expand Up @@ -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('/');

Expand Down
4 changes: 2 additions & 2 deletions src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] {
Expand Down

0 comments on commit a83e576

Please sign in to comment.