Skip to content

Add a tip to the documentation: Scanning extensionless files #3

@gjd6640

Description

@gjd6640

Sometimes projects contain shell script files that have no extension. If you want to scan those with a plugin such as this one you have to give them an extension. Here's a way to do that via a shell command run prior to the Sonar scan.

# Takes any extensionless files and makes copies with '.txtcopy' extensions. This makes us able to run Sonar Text Plugin rules against their content.

find . -type f ! -path '*/.svn/*' ! -path '*/target/*' ! -name "*.*" -exec cp {} {}.txtcopy \;

This copies the extensionless files to create a version that does have an extension. Here I chose a unique extension to make it more obvious that the file name was created by my scan automation.

You also have to add the ".txtcopy" extension to the list that are assigned to the plugin via the Sonar UI's Settings page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions