Skip to main content

Find unused parts of your Robot Framework project

Project description

Robot Framework Find Unused

Find unused parts of your Robot Framework project.

Robocop is great at finding unused parts in a single file. Find unused finds unused parts across all your project files.

Allows you to find unused:

  • Keywords
  • Keyword arguments
  • Keyword return statements
  • Global variables

Installation

Install with pip

pip install robotframework-find-unused

How to use

This is a command-line tool.

  1. Open a command line in your Robot Framework project

  2. Run the following command to show available options:

    robotunused --help
    

Find unused keywords

Walk through your .robot, .resource, and .py files. In those files, count how often each keyword is used (called). Keywords with 0 uses are logged.

By default, will ignore keywords from downloaded libraries.

robotunused keywords

Please note that there are limitations. For an overview of current limitations, run the following command:

robotunused keywords --help

Available options

flag option default description
-c, --show-count Output usage count for all keywords instead of only unused keywords
-f, --filter Globlike pattern Only output keywords who's name match the glob pattern. Match without library prefix
-d, --deprecated include / exclude / only include How to output deprecated keywords
-p, --private include / exclude / only include How to output private keywords
-l, --library include / exclude / only exclude How to output keywords from downloaded libraries
-v, --verbose Show more log output

Find unused keyword arguments

Walk through your .robot, .resource, and .py files. In those files, count how often each argument is used during a keyword call. Arguments with 0 uses are logged.

By default, will ignore arguments from unused keywords.

robotunused arguments

Please note that there are limitations. For an overview of current limitations, run the following command:

robotunused arguments --help

Available options

flag option default description
-c, --show-count Show usage count for all arguments instead of only unused arguments
-f, --filter Globlike pattern Only output arguments for keywords who's name match the glob pattern. Match without library prefix
-d, --deprecated include / exclude / only include How to output deprecated keywords
-p, --private include / exclude / only include How to output private keywords
-l, --library include / exclude / only exclude How to output keywords from downloaded libraries
-v, --verbose Show more log output

Find unused keyword return statements

Walk through your .robot, .resource, and .py files. In those files, count how often each keyword return value is used (assigned to a variable). Keywords whose return value is never useds are logged.

By default, will ignore keywords from downloaded libraries.

robotunused returns

Please note that there are limitations. For an overview of current limitations, run the following command:

robotunused returns --help

Available options

flag option default description
-c, --show-count Output usage count for all keywords instead of only keywords with unused returns
-f, --filter Globlike pattern Only output keywords who's name match the glob pattern. Match without library prefix
-d, --deprecated include / exclude / only include How to output deprecated keywords
-p, --private include / exclude / only include How to output private keywords
-l, --library include / exclude / only exclude How to output keywords from downloaded libraries
-v, --verbose Show more log output

Find unused global variables

Walk through your .robot and .resource files. In those files, count how often each variable is used. Variables defined in a variables section with 0 uses are logged.

robotunused variables

Please note that there are limitations. For an overview of current limitations, run the following command:

robotunused variables --help

Available options

flag option default description
-c, --show-count Show usage count for all variables instead of only unused variables
-f, --filter Globlike pattern Only show variables who's name match the glob pattern. Matching without {brackets} and $@& prefixes
-v, --verbose Show more log output

Contributing

I'm open to contributions. Please contact me in the issues.

When contributing, you'll need Poetry to manage dependencies.

Please ensure that you install the develop dependencies as well as the regular dependencies by running the following command:

poetry install --with dev

Linting

You can't merge with lint issues. This is enforced by the pipeline.

To run the linter, use the following command:

poetry run ruff check

Testing

You can't merge with failing tests. This is enforced by the pipeline.

To run all tests, use the following command:

poetry run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework_find_unused-0.2.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_find_unused-0.2.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_find_unused-0.2.0.tar.gz.

File metadata

  • Download URL: robotframework_find_unused-0.2.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Windows/11

File hashes

Hashes for robotframework_find_unused-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2d583a9784207f49baa223c198209807885dc340894141cb2ad6ec7a1923f49a
MD5 057de58483938081adca33ee552a271b
BLAKE2b-256 6b131a59cddfe5eb8c7d73f8e8270798bd8b22a3fe9b6c4ca4e3c810a39e0396

See more details on using hashes here.

File details

Details for the file robotframework_find_unused-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_find_unused-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13b4489c80ab146ab6d00055c38b3a6dfb6a5e9c85c6101469abb0efe5f02aa1
MD5 f1dc4c0a72f7215b40504ceb4a802729
BLAKE2b-256 519ec66b308664c549c8b1a8207ab3493ab980d4424c413aa6915fca315ba639

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page