Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Formatting checks automation for PASCAL/C++ #1

Open
4 tasks
sergey-shambir opened this issue Aug 3, 2018 · 2 comments
Open
4 tasks

[Python] Formatting checks automation for PASCAL/C++ #1

sergey-shambir opened this issue Aug 3, 2018 · 2 comments
Assignees

Comments

@sergey-shambir
Copy link
Collaborator

sergey-shambir commented Aug 3, 2018

  • python script which formats code depending on language
    Script takes one positional argument (input file path) and one switch to select programming language
    Script should be usable as module or as standalone executable script.
    Script should call underlying code formatting tool and then counts lines changed by tool

  • Pascal support with PTOP
    See also our coding conventions and early config for PTOP

  • C++ support with clang-format
    See also our config for clang-format

  • JSON report
    Script should create report in JSON format which contains

  • total number of lines
  • number of lines changed by tool
  • list of line numbers in input file that was changed by formatter
@sergey-shambir sergey-shambir changed the title Formatting checks automation for PASCAL/C++ [tool] Formatting checks automation for PASCAL/C++ Aug 3, 2018
@sergey-shambir sergey-shambir changed the title [tool] Formatting checks automation for PASCAL/C++ [Python] Formatting checks automation for PASCAL/C++ Aug 3, 2018
@sergey-shambir
Copy link
Collaborator Author

Issue with undesired line breaks can be fixed with "-l 255" option for the PTOP.
Hovewer, with this option PTOP sometimes adds extra spaces at the end of line.
This issue can be fixed with postprocessing formatted file: Python script should trim spaces at the end of each string

@sergey-shambir
Copy link
Collaborator Author

Python has module difflib which can be used to estimate difference between unformatted and formatted sources to calculate score.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants