robotframework-robocop

Tool for static code analysis of Robot Framework language

APACHE-2.0 License

Downloads
256K
Stars
182
Committers
20

Bot releases are visible (Hide)

robotframework-robocop - Robocop 2.8.1

Published by bhirsz over 1 year ago

Recent update to configuration argument files in Robocop 2.8.0 introduced a bug where option values were appended by a path to the argument file directory. It should be fixed with this release.

Read more in full release notes.

robotframework-robocop - Robocop 2.8.0

Published by bhirsz over 1 year ago

New release with addition of nested argument configuration files, --list option with filtering by enabled/disabled rule status and new rule missing-doc-resource-file.

Read more in full release notes.

robotframework-robocop - Robocop 2.7.0

Published by bhirsz over 1 year ago

Fixes and improvements to the robocop file configuration, language header support and pre-commit configuration file.

Read more in full release notes.

robotframework-robocop - Robocop 2.6.0

Published by bhirsz almost 2 years ago

This release focuses on better support for Robot Framework 6.0 and improvements to our documentation and spacing rules.

Several other changes are listed in full release notes.

robotframework-robocop - Robocop 2.5.0

Published by bhirsz about 2 years ago

Several changes to our spacing and comments rules and also initial suppport for Robot Framework 5.1 features such as languages or AS markers.

Robot Framework 5.1 support

Language markers

Robocop now supports reading the Robot Framework files in different languages
using --language option. More details in our docs (#646).

WITH NAME deprecated in favour of AS

Alias for library import can be now defined using AS marker (same as in Python).
WITH NAME will be gradually deprecated in the future Robot Framework versions.
That's why we added support for AS marker to existing rules and created new
rule deprecated-with-name which will warn on WITH NAME usage starting from RF 5.1 (#642).

Empty lines handling refactor (#708)

We changed how we're recognizing the empty lines in spacing rules.
Previously consecutive-empty-lines, empty-lines-between-keywords and empty-lines-between-test-cases
rules ignored comments. This lead to suprising behaviours, for example following code reported three empty lines
between keywords:

*** Keywords ***
Keyword
    Pass

    # comment 1

# comment 2

Second Keyword
    Pass

Detecting end of the keyword / test was also not working correctly (in above example # comment 1 should belong
to Keyword and do not count towards empty lines between keywords).
consecutive-empty-lines now also works inside IF, FOR, WHILE and TRY blocks.

Configurable todo-in-comment

New markers parameter in todo-in-comment rule that allows to define your own
markers that should be reported when found in the comment (#674).

Configurable block comments in missing-space-after-comment

New block parameter in missing-space-after-comment rule that allows to define
pattern for block comments that should be ignored by the rule (#689)

Keywords inside run keywords are now parsed

Keywords inside keywords like Run Keywords or Run Keyword If are now recognized
and handled by keyword rules (#691, #520).

Fixes

  • too-few-calls-in-test-case now properly count keywords inside templated tests.
    It is now also possible to ignore templated tests in too-few-calls-in-test-case rule
    with ignore_templated parameter (#685)
  • too-few-calls-in-test-case and too-few-calls-in-keyword now counts new RF 5.0 syntax (such as
    RETURN or BREAK statements). The code inside IF, FOR, WHILE and TRY blocks is now
    also recognized by those rules (#704)
  • several naming rules now reports with more precise location (#290)
  • duplicated import name now acknowledge the aliased name (#699)
  • external rules are now properly loaded from installed Python module (#709)
  • critical failures in Robot Framework that cause Robocop to stop working are now wrapped with more
    user friendly message (#586)

Acknowledgements

Big thanks to everyone:
@ger-kil, @Lucas-C, @antonpaa and @UliSei for raising issues and helping to improve
our documentation.
@rikerfi for extending our comment rules

robotframework-robocop - Robocop 2.4.0

Published by bhirsz about 2 years ago

Several improvements and fixes for Robocop reports & first updates for upcoming Robot Framework 5.1 release. Rule severity can be also be dynamic depending on the rule other parameters.

Reports improvements & fixes

  • Not all reports will be generated when using --reports all option. Some reports were internal only or produced files which may be not desired. Reports that are not enabled by all and only with specific mention (ie --reports sarif) are marked in our docs (reports docs) (#662)
  • It is possible now to change order of the reports in the output using --reports option. Before this release reports were generated in order they are implemented in Robocop code. Now if typu configure --reports x,y then first report x and then report y will be generated. You can also combine it with all if you only want one report at the top and rest in default order: --reports x,all (#664)
  • Invalid report name will now fail and suggest alternative if you made a typo - previously invalid report name was silenty ignored. For example it was possible to configure --reports timestamps (instead of timestamp) and user was not aware of it (#665)

Sarif report

Robocop can now generate report in sarif format. This format is accepted by various CI platforms as result of code scanning and can be used to integrate into Github CI (more details in our docs) (#638)

Configurable rule severity

It is now possible to configure rule to report with different rule severity depending if the rule exceed given thresholds (#614).
For example if you want line-too-long rule to issue warning on lines above 120 characters long and error on lines longer than 200 character you can configure it using severity_threshold:

robocop -c line-too-long:line_length=120 -c line-too-long:severity_threshold:warning=120:error=200

More on the feature in our docs.

too-few-calls-in-test-case rule

New rule too-few-calls-in-test-case. If the test case have less that allowed number of keyword calls (1 by default) it will report an error.

Other

  • Replaced toml with tomli library (for parsing our configuration files). tomli library was selected to be part of Python vendored-in libraries in future Python release (#609)
  • Handle new reserved tags in Robot Framework 5.1 (#660)
  • You can ignore documentation in too-long-test-case and too-long-keyword rules with new ignore_docs parameter (False by default) (#613)
  • Relative paths in the pyproject.toml configuration file are now resolved using configuration file parent directory as parent (and not using tool current working directory which lead to unexpected behaviour) (#612)

Acknowledgements

Big thanks to @ds-dustenharrison, @bollwyvl, @adrszad, @ZephyrusMB, @phermann-DGL, @rikerfi for raising the issues and providing the feedback.

robotframework-robocop - Robocop 2.3.0

Published by bhirsz about 2 years ago

New report and small fix.

Timestamp report

Report that returns Robocop execution timestamp (#628 #637). Example:

Reported: 2022-07-10 21:25:00 +0300

Handle comments with separators inside

When comment in Robot Framework contains more than one space of separator inside, it is recognized as two separate comments under the hood. It lead to a few small bugs when processing such comments - it is now resolved (#634).
Additionally block comments (starting with ###) are now ignored by missing-space-after-comment rule.

Acknowledgements

Big thanks to @MoreFamed , @UliSei for raising the issues and @rikerfi for implementing the timestamp report.

robotframework-robocop - Robocop 2.2.0

Published by bhirsz over 2 years ago

Updates to rule severity and threshold handling.

  • Fixed the bug where the overriden rule severity wasn't taken into account by reports (#623)
  • Threshold severity can be now configured the same way the rule severity is configured (#624)
  • Invalid threshold value now raises an error instead of silently using INFO severity (#624)

Other

Updated Robocop python requirements to ">=3.6". The requirement did not change but we were missing this data in our metadata (#621).

Acknowledgements ๐Ÿ’ช๐Ÿป

@UliSei for raising the issues regarding our rule & threshold severity

robotframework-robocop - Robocop 2.1.0

Published by bhirsz over 2 years ago

This release is purely created by the community - big thanks!

Version Report

New report added by @rikerfi (#616). It will print Robocop version at the end of the scan:

Report generated by Robocop version: 2.1.0

You can configure it using "all" or "version":

robocop --reports version src

Naming rules changes

Update to some of our naming rules done by @jannek76 (#615).

  • wrong-case-in-keyword-name rule received a new parameter: pattern. It allows you to define pattern that will be ignored from the keyword name. It's useful when Robocop doesn't detect the name of the keyword correctly (it works as a workaround for #595).

  • not-allowed-char-in-name split to not-allowed-char-in-name (which now covers test case and keyword names) and not-allowed-char-in-filename (which now covers suite names). Same as the original rule, not-allowed-char-in-filename also accepts patern that defines which characters are not allowed in a name. This split allows you to configure patern separately for suite and test/keyword names.

Acknowledgements ๐Ÿ’ช๐Ÿป

Big thanks to everyone!
@jannek76 For improving our (not-so-simple) naming rules
@rikerfi For adding new report

robotframework-robocop - 2.0.2

Published by mnojek over 2 years ago

Robocop 2.0.2

This 2.0.2 release ๐ŸŽ‰ includes fixes for various parts of Robocop ๐Ÿค– and improves documentation ๐Ÿ“–. Thanks everyone for finding the issues ๐Ÿž and reporting them back to us!

Fixes ๐Ÿ›

  • Fixed rule W0319 (deprecated-statement) which reported deprecation on [Return] statement in RF4 (#589, #590)
  • Rule W0901 (keyword-after-return) no longer reports warning on [Return] not being the last statement when [Teardown] is used at the end of the keyword (#588, #591)
  • Updated rule W0302 (wrong-case-in-keyword-name) to better handle parenthesis used in keyword and test case names (#558, #596)
  • Updated rules W1004 (empty-lines-between-test-cases) and W1005 (empty-lines-between-keywords) to allow comments between keywords and test cases in corresponding sections (#513, #599)
  • Fixed rule W0319 (deprecated-statement) to show deprecation message for Run Keyword Unless keyword only in RF5 (#593, #598)
  • Updated message for rule W0302 (wrong-case-in-keyword-name) to "Keyword name '{{ keyword_name }}' does not follow case convention" to properly reflect what's being checked (#548, #600)
  • Updated rule I0912 (empty-variable) to properly mark variable type in recommendations for empty values (#592, #597)
  • Fixed rule W0202 (missing-doc-test-case) to not report on every test case when templated suite is used.
    Also, a new parameter ignore_templated (set to True by default) is introduced to configure whether the rule should report on missing documentation for each templated test case or not (possible values are: Yes / 1 / True (default) or No / False / 0) (#526, #602)

Other ๐Ÿ“ˆ

  • Updated examples in documentation (README and User Guide) (#601)
  • Added examples in reports documentation (#601)
  • Robocop can now correctly say if a noun is plural or singular (e.g. 2 rules instead of 2 rule(s)) (#601)
  • Fixed small typos in documentation, docstrings and sorted imports in code (#603)
  • Removed repo visualization file (due to problems with related GitHub action) (#607)

Acknowledgements ๐Ÿ’ช๐Ÿป

Big thanks to a great community for finding and reporting bugs! You make the tool better and you rock ๐Ÿค˜ (random order)
@rousku for reporting bug on W0319 (#589)
@IlfirinPL for reporting bugs on W0901 (#588) and I0912 (#592)
@rikerfi for reporting bug on W0302 (#558)
@polewczakp for reporting bug on W1004 (#513)
@MoreFamed for reporting bug on W0319 (#593)
@KUGA2 for reporting issue with W0302 rule's message (#548)
@Leemur89 for reporting bug on W0202 (#526)

robotframework-robocop - 2.0.1

Published by bhirsz over 2 years ago

Fixes

  • Comment section without *** Comments *** section should now not fail when reporting empty-line-after-section (#582)
  • It is now safe to use Robocop 2.0 with Robot Framework 4.1.3 (without breaking on new syntax) (#583)

Other

  • Our dependencies are sorted and normalized (#584)

Acknowledgements

Big thanks to @bollwyvl for improving how we define our dependencies and @oboehmer for finding the issue with sections rules.

robotframework-robocop - 2.0.0

Published by mnojek over 2 years ago

Robocop 2.0

1.5 year of Robocop's devoted service has passed this month but we already made him older with the version 2.0!

The release includes support for Robot Framework 5.0 but the most important thing is that any
custom user-created rules are not compatible with this version and need to be migrated (more about that below).
Moreover, we improved our documentation with the examples for nearly every rule and the layout of the documentation
also changed to a better one! There are 8 new rules, some others are improved, few fixes, performance enhancements
and better exception handling. Please read the complete release notes to familiarize with what Robocop 2.0 has now
to offer.

We would also like to apologize that some bugs waited so long to be fixed. Our plan for the next release is to fix
all bugs that are left in the backlog and add any missing support for RF 5.0. Next, we want to focus on any other
features that we want Robocop to have.

Backward-incompatible changes

  • The rules are now defined as class (instead of a tuple). (#516)
    This makes the code a lot more readable and creation of new rules is a lot easier but... is also causes all
    external rules created by the users not being compatible with RoboCop 2.0. They need to be migrated, so we
    recommend reading the
    "External Rules" chapter from our documentation to
    better understand how it works now. All built-in rules in Robocop are already migrated, but if you have some custom
    ones, you need to migrate them by yourself. In case of any questions or issues, ping as on our
    #robocop-linter Slack channel.
  • Rule W0603 (tag-with-reserved) name has changed to tag-with-reserved-word (#573)
  • Rule E0902 (keyword-after-return-from) has been removed and replaced with W0901 (keyword-after-return) (#576)

Rules

  • NEW: W0609 (duplicated-tags) notifies if the same tag was used several times (#542, #291)
  • NEW: I0914 (if-can-be-merged) suggests merging several IF conditions into one, if they have identical
    conditions (#543, #441)
  • NEW: E0915 (statement-outside-loop) checks if keywords like Exit For Loop (If), Continue For Loop (If) or statements like BREAK, CONTINUE are used only inside the loop (#562, #477, #577)
  • NEW: W0608 (empty-tags) detects [Tags] setting in keywords and test cases that has no values (#508, #440)
  • NEW: W0813 (duplicated-setting) warns user about duplicated setting (e.g. Force Tags) (#572)
  • NEW: W0319 (deprecated-statement) reports when deprecated keyword is used depending on the RF version in use
    (#565, #560, #576)
  • NEW: E0414 (return-in-test-case) detects RETURN statements used outside the keywords (#576)
  • NEW: I0916 (inline-if-can-be-used) suggests whether to replace simple IF with new inline IF (#578, #546)
  • UPDATE: E0303 (keyword-name-is-reserved-word) supports detecting reserved names introduced in RF 5.0 (#570, #568)
  • UPDATE: E0401 (parsing-error) now also detects if positional argument is passed after named argument (#541, #474)
  • UPDATE: E0412 (invalid-for-loop) now better detects any syntax errors in FOR loop (#572)
  • UPDATE: W0603 (tag-with-reserved-word) is extended with another special tags with robot: prefix (#573, #559)
  • UPDATE: W0901 (keyword-after-return) replaces removed rule E0902 (keyword-after-return-from) (#576)
  • REMOVED: E0902 (keyword-after-return-from) (#576)

Fixes

  • Robocop now properly parses keywords that are preceded with a library name (e.g. BuiltIn.Run Keyword If) (#519)
  • Some rules now better point to the place where the issue occurred
  • Many rules have more precise message (#533)
  • Using Gherkin syntax (given, When, Then, And) now doesn't throw an exception (#549, #550)

Other

  • The documentation has been significantly improved with a lot of good practices with real-life
    examples about which code violates specific rule and why (#527, #468, #555)
  • (related to previous one) Rule class now accepts docs argument which is dedicated for providing the extended
    documentation for specific rule (#528)
  • (related to previous one) Jinja templating is now supported in rules' documentation, which means that instead of
    mystical rule message like "Section name should be in format '%s' or '%s'", it can now be defined as
    "Section name should be in format '{capitalized}' or '{uppercase}'" (#534, #535)
  • Robocop now skips reading paths defined in .gitignore file (#531, #476)
  • Exceptions handling has been significantly improved. Now all known issues or possible to catch errors should have
    much better descriptions and additional warning messages. Only unexpected issues now display stacktrace (#521, #530)
  • Some rules that are available only in a specific version of Robot Framework will be properly marked when calling
    robocop --list (enabled/disabled) (#532, #507)
  • New CLI argument -gd/--ignore-default now supports excluding directories and files (and it already has some nice
    default list of ignored paths) (#540, #475)
  • Robocop is now faster since it excludes some files and directories from parsing phase. Depending on the repository
    size, the execution time can be reduced up to 20% (#540, #475)
  • The documentation theme has been changed to "furo" - more readable one which includes better navigation and supports
    dropdowns (#567, #563)
  • version attribute can now be specified for each rule to define which Robot Framework version enables it (#545, #544)
  • Support for Robot Framework 5.0 including:
    • IF, ELSE & ELSE IF conditions support (#551)
    • Updated rule W0603 (more info in Rules section above) (#559)
    • Updated many tests to cover support for RF 5.0 syntax (#574)
    • New rule W0319 (more info in Rules section above) (#565)
    • New rule I0916 (more info in Rules section above) (#546)
  • Added performance tests that create JSON report with test results which later can be compared with previous
    results. They can be run with pytest --benchmark-enable tests. See
    here for more details. (#495, #467)
  • Configuration file is now always loaded first by default and any CLI arguments append to it (#512)
  • General code refactor, updated links in documentation, improved comments and print messages (#577)
  • Added Python 3.10 support (#577)
  • Removed deprecation warnings for the rules updated in the previous releases:
    • "missing-whitespace-after-setting" which is now "not-enough-whitespace-after-setting",
    • "variable-should-left-aligned" which is now "variable-should-be-left-aligned",
    • "0304" which is now "0406",
    • "invalid-char-in-name" which is now "not-allowed-char-in-name".

Acknowledgements

Thanks to our community for staying with us this whole time and for contribution to make Robocop even better!
Special thanks to users that helped with this release:

  • @MoreFamed for suggestion to improve messages of some rules (#500)
  • @d-biehl for reporting a bug about Gherkin being not fully supported by Robocop (#549)
  • @bithium for creating PR that improved how configuration is loaded (#512)
  • @MalikMlitat for adding new W0319 rule that detects deprecated keywords (#565)

And I (@mnojek) would like to dedicate a huge thank you to @bhirsz who is constantly working on making the tool
better. You are awesome! ๐ŸŽ‰

robotframework-robocop - 1.12.0

Published by bhirsz almost 3 years ago

This small but impactful release addresses the way Robocop deals with the configuration files. And it was fully implemented by our community! After this change all configuration files will be loaded by default (and not only when calling robocop without any options or paths). Configuration from command line will extend loaded configuration. This will allow to have configuration file with all configuration (excluded, included, format etc.) and still being able to run robocop on single source with robocop test.robot.

Features

  • always load configuration files (.robocop and .pyproject.toml) #511

Acknowledgements

Thanks @bithium for creating & implementing the issue.

robotframework-robocop - 1.11.2

Published by bhirsz about 3 years ago

Fix for parsing configuration files with non-ASCII characters.

Fixes

  • Robocop should now parse configuration file with non-ASCI characters (#492)
robotframework-robocop - 1.11.1

Published by bhirsz about 3 years ago

Fix for parsing invalid keyword call syntax inside if statement.

Fixes

  • Robocop should now work properly with incorrectly defined keyword calls inside IF statements (#488)
robotframework-robocop - 1.11.0

Published by bhirsz about 3 years ago

Yet another big release in a row ๐Ÿš€. This time around we bring you 14 new rules - and we finally reached over 100 rules! Most of them try to analyze possible syntax errors and hint you what you possibly did wrong - e.g. if you forgot to put at least 2 spaces after setting. We also included various fixes and improvements for issue reporting.

Unfortunately, there are backward-incompatible changes - E0304, missing-whitespace-after-setting, variable-should-left-aligned and invalid-char-in-name were renamed (details in the release notes).

BTW This week is Robocop's first anniversary ๐ŸŽ‚! What a journey it was - nearly 500 issues on GitHub, 20 releases, over 100 implemented rules, over 340 tests and thousands lines of code. Let the Robocop's watch never ends ๐Ÿ‘ฎโ€โ™‚๏ธ!

New rules

  • W0318 (bdd-without-keyword-call) checks if BDD-reserved keyword was used (Given, When, And, Then, But) with no keyword following it (#159)
Given  # throws warning
Given  Some Keyword  # throws warning. Popular mistake - separating action keyword from BDD keyword
Given Some Keyword 
  • E0811 (duplicated-argument-name) for duplicated argument names. This type of error is silently ignored during execution but leads to unexpected results (#401)
*** Keywords ***
Keyword
    [Arguments]    ${var}    ${var}
    Log  ${var}
  • I0812 (duplicated-assigned-var-name) looks for duplicated names of assigned variables (#480)
${var}  ${var}  ${Var}   My Keyword
  • E0404 (variables-import-with-args) is reported when using variable imports with arguments when resource extension does not allow it (#435)
*** Settings ***
Variables  other.py    arg1  # it's fine
Variables  variables.robot    arg  # not allowed
  • W1015 (misaligned-continuation-row) for alignment of multiline statements (#438)
    Keyword Call
      ...  ${correct}
      ...     ${incorrect}
  • E0412 (invalid-for-loop) for invalid FOR loop syntax (#445)
  • E0413 (invalid-if) for invalid IF statement syntax (#483 #439)
  • E0405 (invalid-continuation-mark) for invalid syntax of continuation line (.. value or .... value) (#483 #439)
  • E0407 (invalid-argument) for invalid syntax of argument (for example [Arguments] 1 string instead of variable name) (#483 #439)
  • E0408 (not-existing-setting) when trying to use setting with not recognized name ([Idontexist]) (#483 #439)
  • E0409 (setting-not-supported) when using setting not available in given type of body - for example [Arguments] in Test Case or [Template] in keyword) (#483 #439)
  • E0410 (not-enough-whitespace-after-variable) for example ${variable} 1 (which will not be recognized as proper variable by Robot) instead of ${variable}ย ย 1 (#483 #439)
  • E0411 (not-enough-whitespace-after-suite-setting) for example Library BuiltIn (not recognized by Robot) instead of Libraryย ย BuiltIn (#463)
  • E1016 (suite-setting-should-be-left-aligned) because settings are not recognized if they are not left aligned (#462)
*** Settings ***
    Library  Collections

Backward-incompatible changes

  • Renamed E0304 rule id to E0406 (name not-enough-whitespace-after-newline-marker did not change). Additionally, this rule catches a lot more instances of this issue
  • Renamed missing-whitespace-after-setting to not-enough-whitespace-after-setting
  • Renamed variable-should-left-aligned to variable-should-be-left-aligned (#478)
  • Rule invalid-char-in-name is renamed to not-allowed-char-in-name. It now accepts a regex pattern as value of configurable (which is renamed from invalid_chars to pattern) and it checks if the name of keyword/test case/suite complies with the regex. (#466) Example of usage:
robocop -c not-allowed-char-in-name:pattern:[.?%]      # reports when one of `.`, `?` or `%` character is found in the name
robocop -c not-allowed-char-in-name:pattern:[^a-zA-Z]  # reports when there are characters different then provided in the regex (note the `^` that negates the match)

Fixes

  • Rule W0807 (duplicated-variables-import) now correctly recognizes arguments passed to variable import (#434)
*** Settings ***
Variables  vars.py  arg1
Variables  vars.py  arg2  # it's not considered duplicate now
  • Rule W0301 (invalid-char-in-name) now correctly ignores all type of variables in keyword name (including patterns in embedded vars) (#457)
  • Files using different encoding (such as Czech or Slovak language) should be now correctly parsed by Robocop (#455)
  • Variable definition with not enough whitespace after variable name will now be properly recognized and will not be reported as other issues (#464)
  • Not enough whitespace after new line mark (...) is now ignored by other rules such as duplicated-variable (#460)
  • All possible parsing errors should now be reported (#461)
  • Loaded configuration from will not be printed if the configuration is empty (#446)

Other

  • Rule W0508 (line-too-long) now ignores lines matching configured pattern. Default pattern is http(s) links (#348)
    It can be configured:
    robocop -c line-too-long:ignore_pattern:your\s+regex\s+pattern <path_to_tests>
  • Robocop now parses Robot Framework DataError instead of reporting it directly as parsing-error. It allows us to give more detailed information about errors (for example when missing whitespace after setting) (#439)
  • Revised and improved reported issue position (line and column) for all rules. Now it's consistent and also more precise for some of the issues (#289)
  • Changed how duplication rules are reported - instead of reporting on each duplicated line, it now reports on original (but it points to original in duplicated message) (#482)
    Multiple keywords with name "Duplicated Keyword" (first occurrence in line 15)
  • Robocop source code is now formatted with black (#485)

Acknowledgements

Thanks @MoreFamed for bug issues

robotframework-robocop - 1.10.0

Published by mnojek about 3 years ago

This huge release introduces 7 new rules and fixes other. Robot Framework 4.1 ๐Ÿค– is now supported. Some great features for developers โŒจ๏ธ like tox are also something new. It also improves the quality of the code ๐Ÿ’ป and documentation ๐Ÿ“„. Thanks to all the contributors for their work! ๐Ÿค Take a look at the details below and have fun using Robocop! ๐Ÿ‘ฎ๐Ÿปโ€โ™‚๏ธ

Remember to upgrade your Robocop with:

pip install -U robotframework-robocop

New rules

  • E0314 (empty-library-alias) checks if alias for library (after WITH NAME) is left empty: (#185)
Library      Collections    WITH NAME
  • W0315 (duplicated-library-alias) if alias for library is the same as the library original name: (#185)
Library      Collections    WITH NAME    Collections
  • W0527 (too-many-test-cases) checks if the number of test cases does not exceed the configured number. (#112)
    This can be easily set by configuring the rule, e.g.:
    robocop -c too-many-test-cases:max_testcases:100 -c too-many-test-cases:max_templated_testcases:200 <path_to_tests>
    Defaults are:
    • 50 test cases for a file (suite)
    • 100 templated test cases for a file (suite)
  • I0912 (empty-variable) detects variables without a value (#294)
  • I0913 (can-be-resource-file) suggests to change file extension to .resource if there are no tests defined inside (#380)
  • I0316 (possible-variable-overwriting) detects possible overwriting of variables that are visually similar but are totally the same as read by Robot Framework parser (#120)
  • I0317 (hyphen-in-variable-name) detects hyphens (-) in variable names when assigning values to prevent from accidental subtraction of values (#271)

Features

  • Listing rules (with --list or --list-configurables options) now also displays a nice summary with amount of rules for each severity: (#416)
(...)
Altogether 6 rule(s) with following severity:
    1 error rule(s),
    2 warning rule(s),
    3 info rule(s).
  • Added support for Robot Framework 4.1: (#433)
    • Support for new special tags (#449)
    • Support for this syntax ${var}['key']['key2'] (#451)

Fixes

  • Fixed a lot of typos in code, output and documentation (#418, #419)
  • semicolon : is now allowed to use when configuring rule, e.g. invalid-char-in-name with configurable invalid_chars (#428)
  • Rule W1007 (uneven-indent) now properly parses indentation with templated test cases and comments (#375)
  • Rule W1003 (empty-lines-between-sections) now supports comments between sections (#448)
  • Rule W0301 (invalid-char-in-name) now doesn't break on embedded arguments (#421)
  • Rules W0701 (todo-in-comment) and W0702 (missing-space-after-comment) now accept more cases when using comments (#447)
  • Robocop disablers should now work properly (More info: #425)

Other

  • Removed deprecation warnings for old rules that were renamed: (#418)
    • setting-name-not-capitalized -> setting-name-not-in-title-case,
    • not-capitalized-keyword-name -> wrong-case-in-keyword-name,
    • missing-doc-testcase -> missing-doc-test-case
  • Some refactor improving readability of the code and its performance (#418, #419)
  • Bug template for GitHub issue is now improved (#426)
  • Block disablers can now be indented (#431)
  • Added pyyaml and tox to dev dependencies in setup.py
  • With introduction of tox, when contributing to codebase, you can now quickly run all tests just by running tox command for both 3 and 4 versions of Robot Framework or you can choose specific one by typing tox -e rf3 or tox -e rf4

Acknowledgements

Thanks @MoreFamed, @haklir, @adrszad for reporting bugs and features.
Thanks @UliSei, @matusaurio for contributing with comments and suggestions.

robotframework-robocop - 1.9.0

Published by bhirsz about 3 years ago

Small improvements to file configurations handling and other fixes. You can now also import external rules from Python packages/modules:

robocop --ext-rules pythonmodule

Features

Fixes

  • Empty lines in argument files can be now used #405
  • Fix issue with configuring severity of rule #402

Other

  • toml module is now installed together with robocop for default support for pyproject.toml file

Acknowledgements

Thanks for @fdaguin and @MoreFamed for reported issues and ideas

robotframework-robocop - 1.8.1

Published by bhirsz about 3 years ago

Release fixing issue with parsing configuration files.

Fixes

  • Fix parsing option with values from config files #396
robotframework-robocop - 1.8.0

Published by bhirsz over 3 years ago

A lot of new rules and changes - with huge number of contributions from others! ๐Ÿš€
Some of the rules change names - see next section for more details.

Rule names changes

  • Rename missing-doc-testcase to missing-doc-test-case
  • Rename not-capitalized-keyword-name to wrong-case-in-keyword-name
  • Rename setting-name-not-capitalized to setting-name-not-in-title-case

Features

  • New rule for empty keyword or test case name (E0312 keyword-name-is-empty and E0313 test-case-name-is-empty) #337
  • New rule W1012 consecutive-empty-lines checking for more than consecutive_empty_lines = 1 empty lines #365
  • New rule W1013 empty-lines-in-statement checking for empty lines inside multi line statement #371
  • Tag rules now also parse tags defined in last line of documentation #194
  • New rule E0403 missing-keyword-name for calling variables without keyword name #386
  • New rule E1014 variable-should-left-aligned for ensuring that variables in variables section are left aligned #293

Fixes

  • Enforce utf-8 encoding when reading file for RawCheckers to fix problems with different encodings (such as inccorectly calculcated length of line) #356
  • Fix invalid documentation regarding configuring format of the message #368
  • W1004 empty-lines-between-test-cases should now ignore templated tests #367
  • E0801 duplicated-test-case should now work correctly with normalized names #376
  • Robocop will now not show W1003 empty-lines-between-sections after keyword section if the number of lines is correct #382
  • format can be now used in .robocop configuraton file #387

Other

  • When using invalid rule name Robocop will now throw exception listing close matches (if any) #358 #361
  • Allow to check only first word for capitalization in W0302 (wrong-case-in-keyword-name) #359
  • Documentation improvements #385

Acknowledgements

Special thanks for:

  • @rauttiz for reporting issues with line length checker
  • @MoreFamed that provided enhancement idea for our error handling and idea for optional configuration for 0302 rule
  • @bollwyvl for including our license inside our package
  • @d-biehl that dicovered issues when parsing test cases and keywords without name and also reported & fixed #376
  • @rdagum that reported issue invalid documentation for rule name inside format option and suggested ignoring some of the issues when parsing code with templated tests
  • @kvo-harmoney for idea of rule checking for consecutive empty lines
  • @yo-ga for adding parsing tags from last line of documentation and implementing rule for checking if variables inside variables section are left aligned
  • @j3n5h for reporting & fixing issue with detecting number of empty lines after keyword section
  • @Calletje234 for reporting issue with configuring format of output message in config file