mwittrock / cpilint

Automating your SAP Cloud Integration governance since 2019.
MIT License
58 stars 20 forks source link

Exact Path for saving rules.xml file #10

Closed SaiBandaru1001 closed 2 years ago

SaiBandaru1001 commented 2 years ago

Exact Path for saving rules.xml file?

mwittrock commented 2 years ago

Hi. You can save the rules file anywhere you want. You run CPILint from the command line. If you run it from the same directory that holds the rules file, the -rules option just needs the name of of the file. Otherwise, pass it the path to the rules file.

SaiBandaru1001 commented 2 years ago

Hi,

Thanks for your reply.

I have saved the rules file in the same location where I installed the cpilint, but still when I'm trying to run the query I get the below one.

The provided rules file does not exist.

Below is the query that I'm using. cpilint -rules disallow-log4j.xml -tmn-host -username

and tried with the path as well, still getting the same error.

Could you please do the needful.

Many thanks, SaiBandaru.

On Fri, 17 Dec 2021, 4:32 am Morten Wittrock, @.***> wrote:

Hi. You can save the rules file anywhere you want. You run CPILint from the command line. If you run it from the same directory that holds the rules file, the -rules option just needs the name of of the file. Otherwise, pass it the path to the rules file.

— Reply to this email directly, view it on GitHub https://github.com/mwittrock/cpilint/issues/10#issuecomment-996260250, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW6OFKBS4XZGGFEVOSBSCNLURJVZZANCNFSM5KHIG6LQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

mwittrock commented 2 years ago

Hi

The rules file doesn't have to be in the same directory you installed CPILint (in fact it probably shouldn't be). What matters is the directory you run the command from.

In your case, if you do "dir disallow-log4j.xml" from the command line and it doesn't find the file, your command won't work. Either run it from the same directory that holds the disallow-log4j.xml file or give an absolute or relative path to it. So instead something like -rules \some\path\disallow-log4j.xml (if you are on Windows, use forward slashes if you are not).

This is a command line usage/file system thing, not a CPILint issue.

Regards,

Morten