Page MenuHomePhabricator

Added clang-format-linter instructions
AbandonedPublic

Authored by tfu on Aug 16 2021, 2:47 PM.

Details

Test Plan

TBD

Diff Detail

Repository
rDEVDOC Development Docs
Branch
clang
Lint
No Lint Coverage

Event Timeline

tfu requested review of this revision.Aug 16 2021, 2:47 PM
Restricted Application completed remote builds in Restricted Buildable.Aug 16 2021, 2:47 PM

When modifying documentation, make sure you build it and check it locally on your system, and address any warnings there might be.

With this repository, you only need to run make html. It will display warnings if there are any problems that need to be addressed. When finished, you can open the documentation directly in the web browser with file:///path/to/the/repository/build/html/index.html (note, there are THREE / after the colon.)

source/guides/building.rst
106
112–114

The code block has to be indented.

119–122

Indentation needed here too.

This revision now requires changes to proceed.Aug 21 2021, 10:06 AM

Fixed indentation and other error

Restricted Application completed remote builds in Restricted Buildable.Aug 28 2021, 5:05 PM
jcmcdonald added inline comments.
source/guides/building.rst
79
83

Package names should be in literal (monospace).

91–92

Run them where? Anywhere, or from within a particular directory or repository? Does it need to be run in each repository? (If none of the above, that's fine. I just need to double-check.)

99

Need a leading newline here so it doesn't merge into the code block.

This revision now requires changes to proceed.Aug 28 2021, 5:57 PM
Restricted Application completed remote builds in Restricted Buildable.Aug 29 2021, 4:11 PM

These steps will need to be added to the Git and Arcanist document.

These steps will need to be added to the Git and Arcanist document.

Should I move it from here to the Git and Arcanist document? Or should I have it in both places?

I'm not sure. Do you need to run this on each repository?

I'm not sure. Do you need to run this on each repository?

Only repositories that use C++. I saw that some were in python.

That will need to be documented somehow too. It's an additional step that will be very confusing to future interns if they don't know about it.

Huh. I just figured something out that would simplify everything. I thought it was strange that there was an arcanist-clang-format-linter package on Ubuntu, but that we couldn't seem to use it. On that page for the Debian package, I found the link to the repository: https://github.com/pwithnall/morefas-phabricator

That suggested the ability to install globally, instead of with git submodule.

I checked one of the repos where I hadn't yet installed the submodule, and arc lint --everything failed with the error message.

Then I adjusted the .arcconfig file in one of the repos where I hadn't yet installed the submodule.

{
	"phabricator.uri" : "https://phab.mousepawmedia.com",
	"repository.callsign" : "I",
	"load" : [
		".arclibs/cppcheck",
		"clang-format-linter"
	]
}

Running arc lint --everything ran clang-format-linter that time. No submodule needed!

Now, that said, for someone who is not on an Ubuntu-based OS, they'll need to clone the morefas-phabricator repository to their system manually. Use locate arcanist to find the path where arcanist is installed (e.g. /usr/share), navigate to that directory, and then run...

cd /usr/share   # or whatever path given by 'where arcanist'
sudo git clone https://github.com/pwithnall/morefas-phabricator.git clang-format-linter

That should make it available to Arcanist as well, according to the README for that repo.

Sorry I couldn't find this info before. The above will be a more user-friendly way of installing clang-format-linter, instead of having to remember to run git submodule each time. (It will be hard for many interns and contributors to understand that command!)

Huh. I just figured something out that would simplify everything. I thought it was strange that there was an arcanist-clang-format-linter package on Ubuntu, but that we couldn't seem to use it. On that page for the Debian package, I found the link to the repository: https://github.com/pwithnall/morefas-phabricator

That suggested the ability to install globally, instead of with git submodule.

I checked one of the repos where I hadn't yet installed the submodule, and arc lint --everything failed with the error message.

Then I adjusted the .arcconfig file in one of the repos where I hadn't yet installed the submodule.

{
	"phabricator.uri" : "https://phab.mousepawmedia.com",
	"repository.callsign" : "I",
	"load" : [
		".arclibs/cppcheck",
		"clang-format-linter"
	]
}

Running arc lint --everything ran clang-format-linter that time. No submodule needed!

Now, that said, for someone who is not on an Ubuntu-based OS, they'll need to clone the morefas-phabricator repository to their system manually. Use locate arcanist to find the path where arcanist is installed (e.g. /usr/share), navigate to that directory, and then run...

cd /usr/share   # or whatever path given by 'where arcanist'
sudo git clone https://github.com/pwithnall/morefas-phabricator.git clang-format-linter

That should make it available to Arcanist as well, according to the README for that repo.

Sorry I couldn't find this info before. The above will be a more user-friendly way of installing clang-format-linter, instead of having to remember to run git submodule each time. (It will be hard for many interns and contributors to understand that command!)

I see. I will edit all the repositories that added the submodule and remove them. Then I will change the arcconfig accordingly. Thanks for finding this and sorry for not noticing this earlier.

I realized we also need to have the arclint file setup to have it work properly on cpp and hpp files. I will make sure to do that for all the necessary repositories.