{"id":4746,"library":"robotframework-robocop","title":"Robot Framework Robocop","description":"Robocop is a static code analysis tool (linter) and code formatter specifically designed for Robot Framework. It uses the official Robot Framework parsing API to analyze files and enforce code quality standards and formatting. Currently at version 8.2.5, the library maintains an active development status with regular minor/patch releases and impactful major version updates approximately once a year.","status":"active","version":"8.2.5","language":"en","source_language":"en","source_url":"https://github.com/MarketSquare/robotframework-robocop","tags":["robot-framework","linter","formatter","static-analysis","code-quality"],"install":[{"cmd":"pip install -U robotframework-robocop","lang":"bash","label":"Standard Installation"},{"cmd":"pip install -U robotframework-robocop[mcp]","lang":"bash","label":"Installation with MCP server support (for AI assistants)"}],"dependencies":[{"reason":"Requires Python 3.10 or newer.","package":"Python","optional":false},{"reason":"Requires Robot Framework 5.0 or newer.","package":"Robot Framework","optional":false}],"imports":[{"note":"Primary use is via CLI; this import is for extending Robocop with custom rules. Direct programmatic use for end-user linting/formatting is less common.","symbol":"VisitorChecker","correct":"from robocop.checkers import VisitorChecker"}],"quickstart":{"code":"# To lint Robot Framework files in the current directory:\nrobocop check\n\n# To format Robot Framework files in the current directory:\nrobocop format\n\n# To lint a specific file:\nrobocop check path/to/your_file.robot\n\n# To format a specific file:\nrobocop format path/to/your_file.robot\n\n# For help with available commands and options:\nrobocop -h","lang":"bash","description":"Robocop is primarily a command-line interface (CLI) tool. The most common way to use it is by running `robocop check` for linting or `robocop format` for code formatting in your project directory."},"warnings":[{"fix":"Upgrade Python to 3.10+ and Robot Framework to 5.0+. If you must lint Robot Framework 4 code with Robocop 8.0.0+, ensure Robocop is installed in a compatible environment and use the `--target-version RF4` option to simulate RF4 parsing rules.","message":"Version 8.0.0 dropped support for Python 3.9 and Robot Framework 4. Ensure your environment meets the new requirements (Python 3.10+, Robot Framework 5.0+).","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Remove `deprecated-statement`, `ReplaceReturns`, and `AddMissingEnd` from your Robocop configuration. New rules replace the functionality of `deprecated-statement`, and automatic fixes are now available for `deprecated-return-keyword`.","message":"In version 8.0.0, the `deprecated-statement` rule was split and removed, and the `ReplaceReturns` and `AddMissingEnd` formatters were deprecated/removed. Your configurations might need updating.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Update your IDE's Robot Framework plugin (e.g., RobotCode) to a version compatible with Robocop 8.0.0+. Consult the plugin's documentation or issue tracker for compatibility details.","message":"Major version updates (e.g., to 8.0.0) can break compatibility with IDE plugins like RobotCode due to internal API changes. Check for updated plugin versions if you encounter issues.","severity":"gotcha","affected_versions":">=8.0.0"},{"fix":"Configuration is loaded from `.robocop` (if no CLI args are given) or `pyproject.toml` (`[tool.robocop]` section) if `.robocop` is not found and `toml` is installed. CLI options explicitly override file configurations. The closest configuration file to the scanned target is used. Use `robocop -h` for details on command-line options and configuration loading.","message":"Robocop supports multiple configuration methods (`.robocop` file, `pyproject.toml`, `--argumentfile` CLI option). Understand the precedence rules to avoid unexpected behavior.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}