rems-project / cn-tutorial

8 stars 9 forks source link

Script that parses examples, categorizes with tags and folders #8

Closed scuellar closed 3 months ago

scuellar commented 6 months ago

WIP: This PR is work in progress while we figure out if it's truly useful. I'll keep it up to date with main.

This adds a small python script that reads tags in all examples and gathers a summary. Useful for finding, for example, all the files that use for loops, that have a main function, that use bitwise operations, or manipulate pointers.

To tag a file

Add the top of the file, add a comma separated list of tags in front of // Tags, like so

// Tags: simple, bitwise operations, pointers, main, 

To gather tags Run

./get_tags.py

This will create a file examples_summary.md with the list of tags and all the examples per tag. It also gathers the files by classification (working, broken/error-proof, etc).

Full usage:

    usage: get_tags.py [-h] [-v] [-o OUT]

    Scan directories and process tags and categories.

    options:
      -h, --help         show this help message and exit
      -v, --verbose      print output to standard output as well as writing to file
      -o OUT, --out OUT  specify the output file name
septract commented 3 months ago

@scuellar Perhaps for the sake of git hygiene we should close and archive this PR? Unless you want to pursue this idea further

scuellar commented 3 months ago

@scuellar Perhaps for the sake of git hygiene we should close and archive this PR? Unless you want to pursue this idea further

Good idea. If this is useful in the future, it should be easy to resurrect.

I'll close the issue for now.