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

clang_format_all.sh: add support for clang-format-12/13/14/15 #2512

Merged
merged 5 commits into from Mar 13, 2023

Conversation

gemesa
Copy link
Contributor

@gemesa gemesa commented Mar 13, 2023

Updated clang_format_all.sh to accept clang-format-12/13/14/15 according to #2511 (comment). I removed the minor version number as they are usually 0 in the new release model.
I tested the different versions to make sure they output the same code:

gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ ./build/clang_format_all.sh clang-format-12
Located clang-format-12
gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ git status
On branch clang-format-x
Your branch is up to date with 'origin/clang-format-x'.

nothing to commit, working tree clean
gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ ./build/clang_format_all.sh clang-format-13
Located clang-format-13
gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ git status
On branch clang-format-x
Your branch is up to date with 'origin/clang-format-x'.

nothing to commit, working tree clean
gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ ./build/clang_format_all.sh clang-format-14
Located clang-format-14
gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ git status
On branch clang-format-x
Your branch is up to date with 'origin/clang-format-x'.

nothing to commit, working tree clean
gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ ./build/clang_format_all.sh clang-format-15
Located clang-format-15
gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ git status
On branch clang-format-x
Your branch is up to date with 'origin/clang-format-x'.

nothing to commit, working tree clean

Testing to see if it also works without a cmd line arg and with default clang-format:

gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ ./build/clang_format_all.sh
Located clang-format-12
gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$ ./build/clang_format_all.sh clang-format
Located clang-format
gemesa@ubuntu-pc:~/git-repos/aircrack-ng-gemesa$

Testing to see what happens if no proper version of clang-format is installed:

Modify clang_format_all.sh manually:

...
CLANG_VERSION=(9 10 11)
...
$ ./build/clang_format_all.sh                
Couldn't find a correct clang-format version, was looking for 9/10/11
Aircrack-ng requires a very specific clang-format version to ensure there isn't
any variance between versions that can happen. You can install it as
'clang-format-9/10/11' so that it doesn't interfere with any other
versions you might have installed, and this script will find it there

@Mister-X-
Copy link
Collaborator

Aside from indentation issues, it's ready to merge.

@gemesa
Copy link
Contributor Author

gemesa commented Mar 13, 2023

Aside from indentation issues, it's ready to merge.

fixed

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

Successfully merging this pull request may close these issues.

None yet

2 participants