Giter VIP home page Giter VIP logo

Comments (4)

idanpa avatar idanpa commented on July 27, 2024

Hi @tolezk, thanks for opening this issue!

  1. --showfile - seems reasonable to support this flag, feel free to open a PR (need to adjust the regex if showfile arg was given).
  2. It is possible to adjust the cwd of the checkpatch process, but seems overcomplicated to me. checkpatch would run from the root dir of your project, so you can have the .checkpatch.conf file waiting for it in there, alternatively, you can adjust checkpatch.checkpatchArgs on settings.json if you want to adjust the flags for specific workspace/globally.

from vscode-checkpatch.

tolezk avatar tolezk commented on July 27, 2024

I've made a PR (#8) to cover 1. '--showfile'.

Now some thoughts about 2: run checkpatch for a particular file.

I think it should be similar to checkpatchCommit() in terms of CWD inheritance etc.
Running a linter from the root workspace is a quite basic use-case because a project workspace layout may be somehow tricky. For example:

vscode_workspace:
|
|--root_workspace (some complex project with many directories and subprojects inside)
|  |--dir1
|  |
|  |--dir2
|  |
|  |--dir3
|  |
|  |--subproject_A
|  |
|  |--subproject_B
|  |
|  |--scripts/checkpatch.pl (this one may be a non-standard somehow modified to cover custom requirements)
|  |--.checkpatch.conf
|  
|--subproject_A_of_root_workspace  
|  |--dir1
|  |
|  |--dir2
|  |
|  |--.checkpatch.conf
|
|--subproject_B_of_root_workspace  
|  |--dir1
|  |
|  |--dir2
|
|--linux
   |--arch
   |
   |--... (all the kernel stuff)
   |
   |--scripts/checkpatch.pl
   |--.checkpatch.conf

Here we have:

  • root_workspace: this contains modified implementation of checkpatch.pl script and its config .checkpatch.conf
  • subproject_A_of_root_workspace: this relies on root_workspace checkpatch.pl, but has own config
  • subproject_B_of_root_workspace: this relies on root_workspace checkpatch.pl and config
  • linux: this has its own well-defined checkpatch.pl and .checkpatch.conf

To keep things playable in even a such case my proposal is to let a user define folder-level settings inside each folder, where required. And it still would keep backward compatibility with the current implementation. And would give the flexibility to achieve these goals.

Some details. Several options (checkpatchPath, checkpatchArgs, exclude) I want to switch to 'resource' scope. Also, I want to introduce a new option useWorkspaceAsCwd with the same scope which would let to consider the folder it applied to as CWD.

from vscode-checkpatch.

tolezk avatar tolezk commented on July 27, 2024

I want you to confirm that proposal is ok to you and I will prepare the next PR to implement. Or we may have some discussion about.

from vscode-checkpatch.

tolezk avatar tolezk commented on July 27, 2024

Anyway, I've implemented all the stuff. Now preparing a new PR.

from vscode-checkpatch.

Related Issues (5)

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.