Skip to content

Commit

Permalink
Allow for include/exclude to check for contract name
Browse files Browse the repository at this point in the history
  • Loading branch information
b00ste committed Jul 10, 2023
1 parent fb162a9 commit ab070cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ async function generateDocumentation(hre: HardhatRuntimeEnvironment): Promise<vo

const qualifiedNames = await hre.artifacts.getAllFullyQualifiedNames();
const filteredQualifiedNames = qualifiedNames.filter((filePath: string) => {
const relativeFilePath = filePath.split(':')[0];
const [relativeFilePath, contractName] = filePath.split(':')[0];
// Checks if the documentation has to be generated for this contract
const includesPath = config.include.some((str) => relativeFilePath === str);
const excludesPath = config.exclude.some((str) => relativeFilePath === str);
const includesPath = config.include.some((str) => relativeFilePath === str || contractName === str);
const excludesPath = config.exclude.some((str) => relativeFilePath === str || contractName === str);
return (config.include.length === 0 || includesPath) && !excludesPath;
});

Expand Down

0 comments on commit ab070cb

Please sign in to comment.