Commit Graph

321 Commits

Author SHA1 Message Date
Daniel Marjamäki 9b674fa306 Revert "Add MISRA 18.4 check (#1966)"
This reverts commit 3ff7ef0918.
2019-07-08 08:10:25 +02:00
Georgy Komarov 3ff7ef0918 Add MISRA 18.4 check (#1966)
* Add MISRA 18.4 check

* Fixup

* Quickfix
2019-07-07 21:54:08 +02:00
fuzzelhjb 999aa407f4 add CERT MSC24-C check (#1903)
* add CERT MSC24-C check

* make check a bit more robust

* fix cert tester

* finetune MSC24 check
2019-07-04 12:19:52 +02:00
fuzzelhjb 1887bd3cf0 add CERT STR11-C check (#1902)
* add CERT STR11-C check

* fix some logical checks

* fix merge issue

* update str11 check
2019-07-02 11:44:24 +02:00
Georgy Komarov f8c350fc70 misra.py: Add R18.7 check (#1934)
* misra.py: Add 18.7 check

* Simplify R18.7 check

* use token.link

* Remove isStruct method
2019-07-01 07:00:43 +02:00
Sebastian 2c71b47d4e
Addons scripts: Remove redundant code/characters, fix indentation. (#1926) 2019-06-27 06:59:47 +02:00
fuzzelhjb 9a7ecd622c add CERT exp15-c check (#1897)
* add CERT exp15-c check

* fix false positive

* remove useless check

* fine tune check and test
2019-06-26 18:49:47 +02:00
Georgy Komarov be5778c416 misra.py: Expand ~ in file paths (#1924) 2019-06-26 07:30:08 +02:00
Sebastian ba0ca5d087
addons/misra.py: Fix comparison instead of assignment (#1920) 2019-06-25 19:18:31 +02:00
Sebastian d1386112a9
addons/cppcheckdata.py: Fix missing self, and wrong assignment. (#1919)
I am not sure but it looks like "self." is missing here.
And the attribute "inconclusive" is initialized as a "bool", so i guess
"True" should be assigned here?
2019-06-25 19:16:57 +02:00
Georgy Komarov 5d58b14db8 misra.py: Update output according c97dc79 (#1917) 2019-06-25 00:42:13 +02:00
Daniel Marjamäki c97dc79815 --addon: Use json for addon output 2019-06-24 19:29:43 +02:00
fuzzelhjb f36d671bc5 add CERT STR03-C check (#1898)
* add CERT STR03-C check

* fix cert test
2019-06-24 18:41:43 +02:00
Georgy Komarov 05bb4a0c8f misra.py: Fixup rules severity (#1911)
* misra.py: Fixup rules severity

* Divide cppcheck and MISRA severity.
2019-06-23 14:08:05 +02:00
Daniel Marjamäki bd59999fd0 cert.py: Use cppcheck.getArguments instead of local implementation 2019-06-23 14:05:24 +02:00
fuzzelhjb 8fcfe0ceb0 add CERT STR07-C check 2019-06-23 13:59:24 +02:00
Daniel Marjamäki 63bd29d644 addons/cppcheckdata.py: Add 'cppcheckdata.getArguments' function 2019-06-23 13:54:33 +02:00
Georgy Komarov 02cc9ffcd8 misra.py: Add --verify-rule-texts option. (#1909)
* misra.py: Add verify-rule-texts option.

* Capture stdout output in travis.
2019-06-19 21:57:27 +02:00
Georgy Komarov e979b0652c misra.py: Fix up and improve load rules parser. (#1895)
* misra.py: Fixup load rules parser.

* misra.py: Report when rule text is missing in rule-texts file

* misra.py: Allow to skip misra checks not specified in rule-texts.

* misra.py: Remove top-level control flow.

Create separate class that stores settings, instead of global variables.

This is required to perform imports from misra.py for testing purposes.

* misra.py: Add simple pytest test for load rules.

* misra.py: Add document structure tests.

* misra.py: Exit after show rules table.

* misra.py: Add document structure tests.

* misra.py: Fixup import pitfall with python2

* misra.py: Minor fixes
2019-06-17 21:17:29 +02:00
fuzzelhjb 5e3da9e82a add CERT STR05-C check (#1899)
* add CERT STR05-C check

* update check
2019-06-17 20:42:23 +02:00
eivindt 44670005ea Record C/CPP/Posix Standard used for cppcheck in dump file / use this for misra checking (#1782)
* Add cmd parameter for choosing between C90 and C99

Misra specifies different requirements to the uniqueness of
macros/enums/variables depending on what C standard
that's being used.

* Add standards configuration to each dump file

Read standards config from misra addon to decide what rules to use.

* Posix as standard setting should be deprecated.  Don't include this in the xml

* Rewritten to use a switch
2019-06-14 12:06:57 +02:00
Daniel Marjamäki 1584e62367 cppcheckdata: Added 'simpleMatch' function 2019-06-06 15:38:15 +02:00
Daniel Marjamäki 784f2951fb misra: generating misra table 2019-06-01 15:57:19 +02:00
Daniel Marjamäki 7c6d15bb81 Fixed #8658 (false positive: MISRA rule 8.12) 2019-06-01 13:10:20 +02:00
Daniel Marjamäki f204ab88d6 misra feature matrix: I believe Cppcheck handle rule 14.3 2019-05-27 17:28:59 +02:00
Daniel Marjamäki d594b195d4 Misra feature matrix: Cppcheck has checks for 18.2 and 18.3 2019-05-26 20:45:21 +02:00
Daniel Marjamäki d039c388ec Fixed #8582 (Regression MISRA Rule 5.1) 2019-05-26 18:46:35 +02:00
Daniel Marjamäki 54be0bc3cf Misra: Added checker for misra rule 17.7 2019-05-22 21:39:33 +02:00
Mathias Schmid 149c07f475 Fix misra addon rule 4 1 (#1846)
* Modifiy check for MISRA rule 4.1 to avoid skipping constant character literal enclosed by single quotes.
Add test for MISRA rule 4.1 which contains non-compliant cases defined by MISRA C 2012 document.

* Moved additional test cases for MISRA rule 4.1 to appropriate test case section.
2019-05-22 14:33:59 +02:00
Daniel Marjamäki 48dfba429a Fixed #8822 (false positive: MISRA rule 13.4) 2019-04-27 17:43:26 +02:00
Daniel Marjamäki 146326bfaf misra.py: Rewrote rule texts parser 2019-04-16 10:57:31 +02:00
Daniel Marjamäki 7f19a9a255 addon/misra.py: fix problem with summary 2019-04-16 08:45:06 +02:00
Daniel Marjamäki e0da316759 cppcheckdata.py: fix sys.errout 2019-04-16 08:26:58 +02:00
Daniel Marjamäki 97157046f7 addons: /reportErrorCli/reportError/ 2019-04-14 08:54:53 +02:00
Daniel Marjamäki b1b5b27b4e addons: write column in error message(s) 2019-04-13 10:22:13 +02:00
Daniel Marjamäki 8bacfafd01 misra.py: Advisory=>style 2019-04-12 12:30:06 +02:00
Daniel Marjamäki 76e64dce8c misra: fix crash if Misra severity Required/Mandatory/Advisory is not set 2019-04-12 12:28:44 +02:00
Daniel Marjamäki a1c30b834c misra.py: Added rule 20.10 2019-04-11 10:50:07 +02:00
Daniel Marjamäki 3e3c805a66 misra.py: Add rule 20.7 2019-04-11 10:36:02 +02:00
Daniel Marjamäki cb55ccb9b0 misra.py: Fix dereference of None 2019-04-10 21:21:17 +02:00
Daniel Marjamäki b5d9313663 naming.py: Unify addon output 2019-04-10 21:11:50 +02:00
Daniel Marjamäki 7b6d7b9335 threadsafety.py: allow execution with --addon 2019-04-10 21:06:40 +02:00
Daniel Marjamäki 05fcfc85fa findcasts: Unify output 2019-04-10 18:29:46 +02:00
Daniel Marjamäki bf5ad56dba cert.py: Removed CLI 2019-04-10 18:09:27 +02:00
Daniel Marjamäki 466caabbf2 Fixed misc.py test 2019-04-10 07:31:52 +02:00
Daniel Marjamäki 4509b25f97 replace tabs with spaces in cppcheckdata.py 2019-04-10 06:48:16 +02:00
Daniel Marjamäki 4415992a62 Addons: Remove the xml output. You can get xml output from the GUI/command line clients. 2019-04-09 20:42:17 +02:00
Daniel Marjamäki f2889d5c82 Try to unify addon output 2019-04-09 20:36:24 +02:00
Daniel Marjamäki 44dcbda88e Addons: Fixed handling of addon configuration 2019-04-08 19:42:16 +02:00
eivindt ff1114e3c7 Misra explicitly allows spaces between # and the preprocessing tokens (#1781)
* Misra explicitly allows spaces between # and the preprocessing tokens

* Added tests illustrating need for changing preprocessor checking
2019-04-08 18:26:17 +02:00