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

Revert "Use clang-format-4.0 on Ubuntu" #7506

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/clion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ CLion such that the modification may not be immediately apparent. When in doubt,
select away from the target file and back; this will cause the file to refresh
and you can confirm that the file has been modified as expected.

First, make sure you have installed ``clang-format-4.0``
First, make sure you have installed ``clang-format``
(see :doc:`code_style_tools`).

Clang format selected file
Expand All @@ -193,7 +193,7 @@ following values for the fields:

:Name: ``Clang Format Full File``
:Description: ``Apply clang-format to the active file``
:Program: ``clang-format-4.0``
:Program: ``clang-format``
:Parameters: ``-i $FileName$``
:Working directory: ``$FileDir$``

Expand All @@ -207,7 +207,7 @@ following values for the fields:

:Name: ``Clang Format Selected Lines``
:Description: ``Apply clang-format to the selected lines``
:Program: ``clang-format-4.0``
:Program: ``clang-format``
:Parameters: ``-lines $SelectionStartLine$:$SelectionEndLine$ -i $FileName$``
:Working directory: ``$FileDir$``

Expand Down
9 changes: 6 additions & 3 deletions doc/code_style_tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ C/C++: Clang-Format

The
:ref:`Mandatory platform specific instructions <platform_specific_setup>`
already install ``clang-format-4.0``.
already install clang-format. On Ubuntu, you may wish to create an alias
(assuming ``$HOME/bin`` is already on your ``$PATH``)::

ln -s /usr/bin/clang-format-3.9 $HOME/bin/clang-format

You can check whether you've installed it correctly by executing::

clang-format-4.0 --help
clang-format --help

To run clang-format::

clang-format-4.0 -i -style=file [file name]
clang-format -i -style=file [file name]
2 changes: 1 addition & 1 deletion setup/ubuntu/16.04/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ while true; do
# added, since it otherwise duplicates the commented deb-src line.
add-apt-repository -s -y "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main"
apt update
apt install --no-install-recommends clang-3.9 lldb-3.9
apt install --no-install-recommends clang-3.9 clang-format-3.9 lldb-3.9
break
;;
[Nn]*) break ;;
Expand Down
2 changes: 1 addition & 1 deletion tools/lint/clang_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def get_clang_format_path():
if sys.platform == "darwin":
path = "/usr/local/bin/clang-format"
else:
path = "/usr/bin/clang-format-4.0"
path = "/usr/bin/clang-format-3.9"
if os.path.isfile(path):
return path
raise RuntimeError("Could not find required clang-format at " + path)