CleanCode logo
sitemap
SEARCH:

CleanCode PowerShell Libraries v1.2.08 API: CleanCode » SvnTools » Measure-SvnKeywords

Measure-SvnKeywords

NAME

Measure-SvnKeywords

SYNOPSIS

Provides a variety of metrics on SVN keyword usage on your system.

SYNTAX

Measure-SvnKeywords [[-Path] <String[]>] [-Include <String[]>] [-Exclude <String[]>] [-ExcludeTree <String[]>] [-Recurse] [-EnableKeywords] [<CommonParameters>]

DESCRIPTION

For SVN keyword expansion to occur in a particular file, you need 3 things: 1. The file's extension (e.g. *.cs) must be activated in the Subversion configuration file. 2. The particular file must have the particular keywords enabled (via the svn:keywords property) that you wish to use. 3. The file must actually use the particular keyword place holders.

Measure-SvnKeywords generates a report on various aspects of those factors. The report consists of these section:

- Extensions enabled in configuration file
Identifies the extensions in your Subversion configuration file that are activated. Only files in this list of extensions are candidates for keywords substitution.

- Summary of SVN files with keywords
This is a summary of all your SVN files by extension that use SVN keywords; it reports a count of files for each extension.

- All files with keywords not enabled IN CONFIG FILE
Unlike the other sections of the report, this section broadens the domain by ignoring the -Include parameter, if specified. This list tells you if you have any files that use keywords but those keywords are not enabled in the configuration file.

- SVN files without keywords
This list enumerates all files not instrumented with keyword place holders, whether or not the files individually have keywords enabled.

- SVN files without keywords where keywords are enabled
This list enumerates all files not instrumented with keyword place holders, yet having keywords enabled.

- SVN files with keywords to be enabled
This list enumerates all files instrumented with keyword place holders, but where the keywords are not enabled. This particular list is the only list affected by the -EnableKeywords parameter. When you enable that switch, all items in this list have their svn:keywords property updated to allow keyword substitution.

PARAMETERS

-Path <String[]>
        Specifies a path to one or more locations.
        The default location is the current directory (.).

        Required?                    false
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByValue, ByPropertyName)
        Accept wildcard characters?  true

-Include <String[]>
        Retrieves only the specified items. The value of this parameter qualifies
        the Path parameter. Enter a path element or pattern, such as "*.txt".

        The Include parameter is effective only when the command includes
        the Recurse parameter or the path leads to the contents of a directory,
        such as C:\Windows\*, where the wildcard character speci fies the contents
        of the C:\Windows directory.

        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  true

-Exclude <String[]>
        Omits the specified items. The value of this parameter qualifies the
        Path parameter.  Enter a path element or pattern, such as "*.txt".

        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  true

-ExcludeTree <String[]>
        Excludes not just a matching item but also all its children as well.

        Required?                    false
        Position?                    named
        Default value                @()
        Accept pipeline input?       false
        Accept wildcard characters?  true

-Recurse [<SwitchParameter>]
        Gets the items in the specified locations and in all child items of
        the locations. Recurse works only when the path points to a container
        that has children, such as C:\Windows or C:\Windows\*, and not when it
        points to items without children, such as C:\Windows\*.exe.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

-EnableKeywords [<SwitchParameter>]
        When this switch is turned on, then for any file found that uses
        SVN keywords but does not have keywords enabled for substitution, the
        Svn properties of the file are changed to enable keyword substitution
        by adding the svn:keywords property.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

<CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, see 
        about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 

INPUTS

System.String. You can pipe one or more path strings to Get-SvnInfo.

OUTPUTS

Object. The type of object returned is determined by the provider with which it is used.

NOTES



        This function is part of the CleanCode toolbox
        from http://cleancode.sourceforge.net/.

        Since CleanCode 1.1.01.

EXAMPLES


-------------------------- EXAMPLE 1 --------------------------

PS>Measure-SvnKeywords -ExcludeTree Resources -Include *.cs,*.html -Exclude *.designer.cs,AssemblyInfo.cs,NamespaceDoc.cs -Recurse

Report statistics for Visual Studio projects, including all the C# source files but ignoring the designer-generated files and some bookkeeping files. Also ignore entirely the Resources directory and its children. This reports the various SVN keyword metrics but does not change any.

-------------------------- EXAMPLE 2 --------------------------

PS>Measure-SvnKeywords -ExcludeTree Resources -Include *.cs,*.html -Exclude *.designer.cs,AssemblyInfo.cs,NamespaceDoc.cs -Recurse -EnableKeywords

Same as the previous example, but for any file found that uses keywords but does not have keywords enabled for substitution, change the Svn properties of the file to enable keyword substitution (by adding the svn:keywords property).

-------------------------- EXAMPLE 3 --------------------------

PS>Measure-SvnKeywords ...

This example just shows a portion of actual output. The last section (Enabling keywords...) is only done if you explicitly ask for it, via the -EnableKeywords parameter.

        === Extensions enabled in configuration file:
        *.bat    => Author Date Id Rev URL
        *.cmd    => Author Date Id Rev URL
        *.cs     => Author Date Id Rev URL
        ...

        === Summary of SVN files with keywords:
        Extension=.cs   Occurrences= 92
        Extension=.html Occurrences=  3
        Extension=.java Occurrences= 53
        ...

        === All files with keywords not enabled IN CONFIG FILE:
        None

        === SVN files without keywords (13 files):
        Extension=.bat  Occurrences=  4
            *****C:\code\cleancode-support\ftp-upload-script.bat
            *****C:\code\dotnet\Projects\SqlDiffFramework\installer\package.bat
            *****C:\code\js\ccwebpages\jsmake.bat
            *****C:\code\js\validate\jsmake.bat
        Extension=.cs   Occurrences=  3
            *****SqlDiffFramework\SqlDiffFramework\OptionsPanels\DifferencePanel.cs
            *****SqlDiffFramework\SqlDiffFramework\OptionsPanels\GeneralPanel.cs
            *****SqlDiffFramework\SqlDiffFramework\Program.cs
        Extension=.html Occurrences=  3
            *****C:\code\powershell\CleanCode\Assertion\module_overview.html
            *****C:\code\powershell\CleanCode\IniFile\module_overview.html
            *****C:\code\powershell\CleanCode\namespace_overview.html
        Extension=.pl   Occurrences=  1
            *****C:\code\cleancode-support\pscaption.pl
        Extension=.ps1  Occurrences=  2
            *****C:\code\powershell\scripts\AnalyzeMySvnKeywords.ps1
            *****C:\code\powershell\scripts\GenerateCleanCodeAPI.ps1

        === SVN files without keywords where keywords are enabled (6 files):
        Extension=.cs   Occurrences=  3
            *****SqlDiffFramework\SqlDiffFramework\OptionsPanels\DifferencePanel.cs
            *****SqlDiffFramework\SqlDiffFramework\OptionsPanels\GeneralPanel.cs
            *****SqlDiffFramework\SqlDiffFramework\Program.cs
        Extension=.pl   Occurrences=  1
            *****C:\code\cleancode-support\pscaption.pl
        Extension=.ps1  Occurrences=  2
            *****C:\code\powershell\scripts\AnalyzeMySvnKeywords.ps1
            *****C:\code\powershell\scripts\GenerateCleanCodeAPI.ps1

        === SVN files with keywords to be enabled (3 files):
        Extension=.cs   Occurrences=  2
            *****CleanCode\CleanCode\Diagnostics\EnumerableDebugger.cs
            *****CleanCode\GeneralComponents\Controls\ComboBoxWithTooltip.cs
        Extension=.ps1  Occurrences=  1
            *****C:\code\powershell\CleanCode\SvnTools\SvnKeywords.ps1

        === Enabling keywords on files containing keywords:
        property 'svn:keywords' set on 'CleanCode\Diagnostics\EnumerableDebugger.cs'
        property 'svn:keywords' set on 'CleanCode\GeneralComponents\Controls\ComboBoxWithTooltip.cs'
        property 'svn:keywords' set on 'CleanCode\SvnTools\SvnKeywords.ps1'

RELATED LINKS

This documentation set was created with CleanCode's DocTreeGenerator.

Valid XHTML 1.0!Valid CSS!Get CleanCode at SourceForge.net. Fast, secure and Free Open Source software downloads
Copyright © 2001-2015 Michael Sorens • Contact usPrivacy Policy
Usage governed by Mozilla Public License 1.1 and CleanCode Courtesy License
CleanCode -- The Website for Clean DesignRevised 2015.12.16