Ignore directories with apigeelint

tmcdevitt
Participant I

We're trying to incorporate apigeelint into our CI/CD process.

Part of this process is an "npm install" where our proxy Node code resides (e.g. apiproxy/resources/node). Executing this creates "node_modules" in this location and pulls down all dependencies. This is desired.

In the next phase of our process, we run apigeelint on the apiproxy directory. Since that directory now contains "node_modules" (a few directories down), *everything* is considered for linting by apigeelint, as opposed to *just* our proxy JS code. This is not desired.

Is there a way we can ignore one or more directories with apigeelint? Similar functionality exists in other linting tools like eslint - actually, eslint by default ignores "node_modules".

Any help on this would be greatly appreciated. Thanks!

0 8 765
8 REPLIES 8

Maybe a workaround - do the apigeelint before "npm install"?

Thanks @Dino-at-Google - that may be my only option at this point (and will probably be fine). Longer-term, would be nice to have that as an option for the tool in case it's non-node code that we want to ignore on the linting.

Can you try this forked version of apigeelint?

https://github.com/DinoChiesa/bundle-linter

I changed one line: to ignore the node_modules (always) under resources.

I haven't tested this, but it may solve your problem.

Excellent Dino - thanks for that. Absolutely would like to get some time to work on this. A feature request/bug will get attention.

I filed a pull request.

mgarg
Participant I

Hi @Dino-at-Google

We have used apigee mocker to create mock files and that is also part of our CI/CD pipelines which uses apigeelint for static code analysis. But it is also giving error as we have .xml files under resources node folder.

Could you please update the module and make the following changes

1) Add xml extension in apigeelint\lib\package\plugins\checkBundleStructure.js line number 217

2) Also provide some configuration to configure directory name or path to ignore directory as per requirement.

Regards

Manish Garg

Hi @Manish Garg,

1) Thanks for reporting this, I've created an issue and will take care of it. https://github.com/apigee/apigeelint/issues/142

2) Not quite sure about this requirement, we have a configuration options in our roadmap. Currently, you can specify which plugins you want to ignore using exclude parameter as described here: https://github.com/apigee/apigeelint/pull/128