Skip to content

Commit

Permalink
Merge branch 'main' into feat/new-config
Browse files Browse the repository at this point in the history
  • Loading branch information
excaliborr committed Mar 4, 2024
2 parents 406735d + a3b3ede commit f87aca4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Want to quickly check if your natspec smells?
Just run:

```
npx @defi-wonderland/natspec-smells --include src --exclude "src/**/*.sol" "(test|scripts)/**/*.sol"
npx @defi-wonderland/natspec-smells --include "src/**/*.sol" --exclude "(test|scripts)/**/*.sol"
```

> [!NOTE]
Expand Down
2 changes: 1 addition & 1 deletion src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class Validator {

// Validate natspec for the constructor only if configured
if (matchesFunctionKind(node, 'constructor')) {
return this.config.constructorNatspec ? this.validateParameters(node as FunctionDefinition, natspecParams) : [];
return this.config.functions?.constructor ? this.validateParameters(node as FunctionDefinition, natspecParams) : [];
}

// Inheritdoc is not enforced nor present, and there is no other documentation, returning error
Expand Down
1 change: 0 additions & 1 deletion test/utils/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ASTKind, ASTReader, SourceUnit, compileSol } from 'solc-typed-ast';
import path from 'path';
import { Functions, NodeToProcess } from '../../src/types';

export async function getFileCompiledSource(filePath: string): Promise<SourceUnit> {
Expand Down
2 changes: 1 addition & 1 deletion test/validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ describe('Validator', () => {

describe('with disabled constructor natspec', () => {
beforeAll(async () => {
validator = new Validator(mockConfig({ constructorNatspec: false }));
validator = new Validator(mockConfig({ constructorNatspec: true }));
});

it('should ignore missing constructor natspec', () => {
Expand Down

0 comments on commit f87aca4

Please sign in to comment.