{"id":26432555,"url":"https://github.com/virus-rpi/ffn","last_synced_at":"2026-01-04T21:01:42.835Z","repository":{"id":280059714,"uuid":"940866303","full_name":"virus-rpi/ffn","owner":"virus-rpi","description":"formated function names for v","archived":false,"fork":false,"pushed_at":"2025-03-01T00:43:15.000Z","size":343,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T01:22:54.698Z","etag":null,"topics":["vlang","vlang-cli","vlang-tool"],"latest_commit_sha":null,"homepage":"","language":"V","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/virus-rpi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-01T00:10:42.000Z","updated_at":"2025-03-01T00:43:59.000Z","dependencies_parsed_at":"2025-03-01T01:22:56.818Z","dependency_job_id":"4f532eae-fd64-461c-a211-b151e562119f","html_url":"https://github.com/virus-rpi/ffn","commit_stats":null,"previous_names":["virus-rpi/ffn"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virus-rpi%2Fffn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virus-rpi%2Fffn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virus-rpi%2Fffn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virus-rpi%2Fffn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/virus-rpi","download_url":"https://codeload.github.com/virus-rpi/ffn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166703,"owners_count":20409180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vlang","vlang-cli","vlang-tool"],"created_at":"2025-03-18T06:18:59.760Z","updated_at":"2026-01-04T21:01:42.779Z","avatar_url":"https://github.com/virus-rpi.png","language":"V","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Formatted Function Names (ffn)\n\nThis project provides a tool to convert formatted function names in `.v.ffn` files to standard function names in V. It also includes functionality to watch files or directories for changes and automatically convert them.\nThese formatted function names are useful for writing more readable code and makes it easier to understand give good names to functions.\n\n## Features\n\n- Convert formatted function names in `.v.ffn` files to standard function names.\n- Watch files or directories for changes and automatically convert them.\n\n## Usage\n\n### Command Line\n\nTo use the tool from the command line, run:\n\n```sh\nffn [--watch] \u003cfile_or_directory1\u003e \u003cfile_or_directory2\u003e ...\n```\n\n- `--watch`: Optional flag to watch the specified files or directories for changes.\n- `\u003cfile_or_directory\u003e`: One or more files or directories to convert.\n\n\n## Building from Source\n\nTo build the project from source, just run:\n\n```sh\nv . -prod\n```\n\n### Example\n\nConvert a single file:\n\n```sh\nffn examples/test_file.v.ffn\n```\n\nConvert all files in a directory:\n\n```sh\nffn examples/\n```\n\nWatch a file for changes:\n\n```sh\nffn --watch examples/test_file.v.ffn\n```\n\nWatch a directory for changes:\n\n```sh\nffn --watch examples/\n```\n\n## Example Files\n\n### `examples/useful_example.v.ffn`\n\n```v\nmodule examples\n\nfn abs(x int) int {\n\tif x \u003c 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfn draw_point_at_{x}_{y}_in_{color}(x int, y int, color string) {\n\tprintln('Drawing point at (${x}, ${y}) with color ${color}')\n}\n\nfn draw_line_from_{x1}_{y1}_to_{x2}_{y2}_in_{color}(x1 int, y1 int, x2 int, y2 int, color string) {\n\tdx := x2 - x1\n\tdy := y2 - y1\n\n\tsteps := if abs(dx) \u003e abs(dy)  {abs(dx)} else {   abs(dy) }\n\n\tif steps == 0 {\n\t\tdraw_point_at_{x1}_{y1}_in_{color}()\n\t\treturn\n\t}\n\n\tx_increment := dx / steps\n\ty_increment := dy / steps\n\n\tmut x := x1\n\tmut y := y1\n\tfor _ in 0..steps {\n\t\tdraw_point_at_x_y_in_color(int(x), int(y), color)\n\t\tx = x + x_increment\n\t\ty = y + y_increment\n\t}\n}\n\nfn main() {\n\tdraw_line_from_{0}_{0}_to_{10}_{10}_in_{'red'}()\n}\n```\n\n### `examples/_ffn_useful_example.v`\n\n```v\nmodule examples\n\nfn abs(x int) int {\n\tif x \u003c 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfn draw_point_at_x_y_in_color(x int, y int, color string) {\n\tprintln('Drawing point at (${x}, ${y}) with color ${color}')\n}\n\nfn draw_line_from_x1_y1_to_x2_y2_in_color(x1 int, y1 int, x2 int, y2 int, color string) {\n\tdx := x2 - x1\n\tdy := x2 - y1\n\n\tsteps := if abs(dx) \u003e abs(dy) { abs(dx) } else { abs(dy) }\n\n\tif steps == 0 {\n\t\tdraw_point_at_x_y_in_color(x1, y1, color)\n\t\treturn\n\t}\n\n\tx_increment := dx / steps\n\ty_increment := dy / steps\n\n\tmut x := x1\n\tmut y := y1\n\tfor _ in 0 .. steps {\n\t\tdraw_point_at_x_y_in_color(int(x), int(y), color)\n\t\tx = x + x_increment\n\t\ty = y + y_increment\n\t}\n}\n\nfn main() {\n\tdraw_line_from_x1_y1_to_x2_y2_in_color(0, 0, 10, 10, 'red')\n}\n```\n\n## License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirus-rpi%2Fffn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirus-rpi%2Fffn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirus-rpi%2Fffn/lists"}