VirtualBox

Changeset 69211 in vbox for trunk/src/bldprogs/scmrw.cpp


Ignore:
Timestamp:
Oct 24, 2017 1:53:05 PM (7 years ago)
Author:
vboxsync
Message:

scm: Fixed incorrect comment start column when parsing python doc strings. Display why we don't find license and copyright stuff not well formed and need to redo them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bldprogs/scmrw.cpp

    r69176 r69211  
    10141014                cchWellFormed = RTStrPrintf(szWellFormed, sizeof(szWellFormed), "Copyright (C) %u-%u %s",
    10151015                                            pState->uFirstYear, pState->uLastYear, g_szCopyrightHolder);
     1016            pState->fUpToDateCopyright   = pState->uLastYear == g_uYear;
     1017            pState->iLineCopyright       = iLine;
    10161018            pState->fWellFormedCopyright = cchWellFormed == (uintptr_t)(pszEnd - pszBody)
    10171019                                        && memcmp(pszBody, szWellFormed, cchWellFormed) == 0;
    1018             pState->fUpToDateCopyright   = pState->uLastYear == g_uYear;
    1019             pState->iLineCopyright       = iLine;
     1020            if (!pState->fWellFormedCopyright)
     1021                ScmVerbose(pState->pState, 1, "* copyright isn't well formed\n");
    10201022
    10211023            /* If there wasn't exactly one blank line before the comment, trigger a rewrite. */
    10221024            if (pInfo->cBlankLinesBefore != 1)
     1025            {
     1026                ScmVerbose(pState->pState, 1, "* copyright comment is preceeded by %u blank lines instead of 1\n",
     1027                           pInfo->cBlankLinesBefore);
    10231028                pState->fWellFormedCopyright = false;
     1029            }
    10241030
    10251031            /* If the comment doesn't start in column 1, trigger rewrite. */
    10261032            if (pInfo->offStart != 0)
    10271033            {
     1034                ScmVerbose(pState->pState, 1, "* copyright comment starts in column %u instead of 1\n", pInfo->offStart + 1);
    10281035                pState->fWellFormedCopyright = false;
    10291036                /** @todo check that there isn't any code preceeding the comment. */
     
    10961103                                                : pCur->enmType == kScmLicenseType_Confidential;
    10971104                    pState->fWellFormedLicense  = memcmp(pszBody, pCur->psz, pCur->cch - 1) == 0;
     1105                    if (!pState->fWellFormedLicense)
     1106                        ScmVerbose(pState->pState, 1, "* license text isn't well-formed\n");
    10981107
    10991108                    /* If there was more than one blank line between the copyright and the
     
    11011110                    if (cBlankLinesAfterCopyright > 1)
    11021111                    {
     1112                        ScmVerbose(pState->pState, 1, "* %u blank lines between copyright and license text, instead of 1\n",
     1113                                   cBlankLinesAfterCopyright);
    11031114                        pState->iLineLicense -= cBlankLinesAfterCopyright - 1;
    11041115                        pState->cLinesLicense += cBlankLinesAfterCopyright - 1;
     
    11081119                    /* If there was more than one blank line after the license, trigger a rewrite. */
    11091120                    if (!fExternal && pInfo->cBlankLinesAfter != 1)
     1121                    {
     1122                        ScmVerbose(pState->pState, 1, "* copyright comment is followed by %u blank lines instead of 1\n",
     1123                                   pInfo->cBlankLinesAfter);
    11101124                        pState->fWellFormedLicense = false;
     1125                    }
    11111126
    11121127                    /** @todo Check that the last comment line doesn't have any code on it. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette