Giter VIP home page Giter VIP logo

Comments (17)

dcslin avatar dcslin commented on July 4, 2024

Hi @chrishkchris , I have tested on windows at my side. Could you please check again your configuration? I hope this guide could help: https://github.com/apache/singa-doc/blob/0efbdbee811901fbcd7ce1f2d057669cb246e4c9/docs-site/docs/contribute-code.md

You might need to install LLVM in windows, and add below lines to VS Code configuration:

"[cpp]": {
    "editor.defaultFormatter": "xaver.clang-format"
},
"cpplint.cpplintPath": "path/to/cpplint",

"editor.formatOnSave": true,
"python.formatting.provider": "yapf",
"python.linting.enabled": true,
"python.linting.lintOnSave": true,

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

I have installed LLVM, and the following VS code configuration:

{
"git.ignoreMissingGitWarning": true,
"python.pythonPath": "C:\ProgramData\Anaconda3",

"[cpp]": {
"editor.defaultFormatter": "xaver.clang-format"
},
"cpplint.cpplintPath": "c:\ProgramData\Anaconda3\Scripts\cpplint.exe",

"editor.formatOnSave": true,
"python.formatting.provider": "yapf",
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.pylintEnabled": true,
"python.linting.pylamaEnabled": false,
"C_Cpp.dimInactiveRegions": false
}

Seems to be strange. I think my setting corresponding to clang-formatter is the same as you?

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

is it due to the different of cpplint we uses?
I was using pip install cpplint

from singa.

dcslin avatar dcslin commented on July 4, 2024

hi @chrishkchris have you installed this extension https://marketplace.visualstudio.com/items?itemName=xaver.clang-format

from singa.

dcslin avatar dcslin commented on July 4, 2024

is it due to the different of cpplint we uses?
I was using pip install cpplint

clang-format is independent from cpplint

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

yes, I am using
env

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

version is the same?

from singa.

dcslin avatar dcslin commented on July 4, 2024

version is the same?

extension is auto updated i think

from singa.

dcslin avatar dcslin commented on July 4, 2024

may be for workaround could you try to set 'clang-format.language.cpp.style' this option to google.

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

may be for workaround could you try to set 'clang-format.language.cpp.style' this option to google.

ok, I will try this one

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

may be for workaround could you try to set 'clang-format.language.cpp.style' this option to google.

ok, I will try this one

Yes, this is the solution
need to add in the json
"clang-format.language.cpp.style": "google"

Could you update this to the instruction so everyone can use the same? thanks a lot

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

@shicong I will submit a PR in singa-doc to make this clear in the introduction

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

@shicong I have updated the instruction in apache/singa-doc#4. I will close this issue when everything is okay. Thanks a lot for your advice!

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

In apache/singa-doc#4, I also added also the google style for python yapf :
"python.formatting.yapfArgs" : ["--style" , "{based_on_style: google}" ]
This will be good if VSCode cannot catch the .style.yapf and .clang-format in the project root directory, where I encountered this problem in the remote edit environment (WinSCP)

from singa.

dcslin avatar dcslin commented on July 4, 2024

Hi @chrishkchris FYI
#603

from singa.

nudles avatar nudles commented on July 4, 2024

@chrishkchris is this issue fixed?

from singa.

chrishkchris avatar chrishkchris commented on July 4, 2024

@nudles I think to solve is to use the same version of formatters as well as the same config for all the contributors, where I addressed in the new doc repo for the instruction of how to do the formatting apache/singa-doc#4
Although my method may not resolve 100% of the problem (some people may use not exactly the same version, e.g. LVMM 9.0 vs 10.0), but should resolve most of the problem.

@XJDKC I remembered that Rulin has even proposed a better method than me (the same docker container with the formatter pre-installed, with the same git hooks)

from singa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.