{"id":16539680,"url":"https://github.com/xuhdev/editorconfig-cf","last_synced_at":"2025-10-28T14:31:19.878Z","repository":{"id":14977859,"uuid":"17702974","full_name":"xuhdev/editorconfig-cf","owner":"xuhdev","description":"A tool to check and fix coding style according to .editorconfig file. It passes the fixing tasks to specific language beautifiers.","archived":false,"fork":false,"pushed_at":"2022-01-13T17:19:32.000Z","size":196,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-01T15:22:52.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://editorconfig.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xuhdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-13T08:24:54.000Z","updated_at":"2022-02-07T07:27:54.000Z","dependencies_parsed_at":"2022-09-04T13:01:46.468Z","dependency_job_id":null,"html_url":"https://github.com/xuhdev/editorconfig-cf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuhdev%2Feditorconfig-cf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuhdev%2Feditorconfig-cf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuhdev%2Feditorconfig-cf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuhdev%2Feditorconfig-cf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuhdev","download_url":"https://codeload.github.com/xuhdev/editorconfig-cf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238663027,"owners_count":19509712,"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":[],"created_at":"2024-10-11T18:50:04.794Z","updated_at":"2025-10-28T14:31:19.562Z","avatar_url":"https://github.com/xuhdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EditorConfig-cf -- EditorConfig Checker and Formatter\n\nThis python program uses the rule given in [EditorConfig][] files to check and fix your coding style.\n\nIt is still under development, but your contribution is highly appreciated, since I do not use all languages!\n\n## Usage\n\n    python /path/to/editorconfig_cf.py [check|format] [file1] [file2] [file3] ...\n\nwhere `[file1]`, `[file2]`, `[file3]`, ... are the source files you want to check or format.\n\n## How It Works\n\nThis script does not touch your code directly; instead, it calls language specific beautifier to check and fix.\n\nWhen given a file, it first see what type this file is according to its extension. After determining the type of the\nsource file, EditorConfig-cf tries to call the corresponding beautifiers it knows. If a beautifier is found to be\nusable, EditorConfig-cf calls the beautifier to check or fix the source code and outputs the fixed code into a file with\n`.ecfmt` extension.\n\nFor example, when dealing with a C source file named `main.c`, EditorConfig-cf tries to call [uncrustify][]. If\nuncrustify is available, it will be used to format this C source file, and write the output into `main.c.ecfmt`.\n\n## Contribution\n\n### How Can I Add Beautifier for My Favorite language?\n\nThe framework is already there, what you need is to add your own handling function to handle this type of file with the\nbeautifier in the `handling` directory, then insert a few lines to tell some information about the beautifier (such as name,\nfor what language).\n\nHere are the details.\n\n#### Add Handling Function for Your Beautifier\n\nCreate a new file for your beautifier in the `handling` directory. You need to define a function with the following prototype:\n\n    handling(executable, input_file_path, output_file_path, editorconfig_properties)\n\nWhere `executable` is the `executable` of the beautifier to be passed in, `input_file_path` is the file needs to be\nformatted, `output_file_path` is where the formatted file should be written into, `editorconfig_properties` is the\noutput of EditorConfig library passed in (see [EditorConfig Python Core Document][] for what this variable is), `c_or_f`\nshows whether this is checking ('c') or formatting ('f'). You need to fill this function so that the framework can call\nthis function to handle the specific type of file with the specific beautifier. You will tell the location of this\nfunction later.\n\n#### Add Meta Information of Beautifier\n\nEdit `editorconfig_cf.py`, check the function `get_language_info` and `get_beautifier_info`. Check the existing\nbeautifier and insert meta info of the beautifier you are going to add.\n\n#### Add Tests in the `tests` Directory\n\nThis should be fairly straightforward. Simply refer the other tests and modify it.\n\n### Contribution License\n\nIf you added any new files, remember you need to add a license header as the other files do. If you code is less than 50\neffective lines, you can simply copy a header from another file and copyright it under my name. If you do not want to\ncopyright the code under my name, I will not be against copyright under your name. I encourage you to license under\nLGPLv3+, but at least your license must be compatible with the other part of the project, that is, a permissive license\n(Apache v2, BSD, MIT, etc.) or LGPLv3+. LGPLv2 or GPL are not acceptable.\n\n## License\n\nCopyright (C) Hong Xu \u003chong@topbug.net\u003e\n\nUnless otherwise stated, most files are licensed under [GNU Lesser General Public License Version 3][] or later. See the\nheader of each file for license details.\n\n[uncrustify]: http://uncrustify.sourceforge.net\n[EditorConfig]: http://editorconfig\n[EditorConfig Python Core Document]: http://pydocs.editorconfig.org/en/latest/usage.html\n[GNU Lesser General Public License Version 3]: https://www.gnu.org/licenses/lgpl.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuhdev%2Feditorconfig-cf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuhdev%2Feditorconfig-cf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuhdev%2Feditorconfig-cf/lists"}