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

[CY-2997] directory' with relatively path cause an error #314

Closed
TheColdPot opened this issue Oct 6, 2020 · 9 comments
Closed

[CY-2997] directory' with relatively path cause an error #314

TheColdPot opened this issue Oct 6, 2020 · 9 comments
Labels
jira-issue Issue tracked on JIRA

Comments

@TheColdPot
Copy link

TheColdPot commented Oct 6, 2020

But when I try to add a directory, it says

docker: Error response from daemon: invalid volume specification: 'src/peb.js:src/peb.js': invalid mount config for type "volume": invalid mount path: 'src/peb.js' mount path must be absolute.

It seems to need an absolute path, but how to write this absolute path

@github-actions github-actions bot changed the title directory' with relatively path cause an error [CY-2997] directory' with relatively path cause an error Oct 6, 2020
@github-actions github-actions bot added the jira-issue Issue tracked on JIRA label Oct 6, 2020
@github-actions
Copy link

github-actions bot commented Oct 6, 2020

Internal ticket created : CY-2997

@franciscodua
Copy link
Contributor

franciscodua commented Oct 6, 2020

Hi @TheColdPot

You can either write the absolute path to your folder or $PWD/src.
You can use the $PWD if:

  1. You're using a UNIX based system, e.g., linux or MacOS
  2. You're running the command from the folder where you have the src folder

This is happening because the CLI is trying to launch a Docker container and mapping your directory to the containers. However, this requires an absolute path on the host machine (yours), as you can check here or follow this GitHub thread here.

Let us know if this solution works for you. Meanwhile, I'll update our documentation with this information that the directory should be an absolute path

Update: Disregard this answer. It seems the CLI is already picking up the relative directory and passing an absolute one where needed. It seems the original problem was something else. Check the next comment for more details

franciscodua pushed a commit that referenced this issue Oct 6, 2020
This originated from #314
We hope that having this requirement clear in the documentation avoids future errors
@franciscodua
Copy link
Contributor

franciscodua commented Oct 6, 2020

Hi again @TheColdPot
I just noticed you're using the GitHub action in an open-source project 😅. This way is easier to understand what's going on.

In here it looks you're trying to pass a list of javascript files to be analyzed. But the directory parameter should be a directory only. So, you should pass the src only.

However, if your goal is to analyze javascript files only, you can run it for the whole repository (without specifying that parameter) and add a configuration file to your root folder like this. In this configuration file, you can specify which tools should run, and even if you want to exclude some files.

I hope this helps more than the previous answer.

@TheColdPot
Copy link
Author

TheColdPot commented Oct 7, 2020

The first answer helps me
but then it can not get .jshintrc

Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:373 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:194 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:84 (iterator)
Found [Warning] `'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:90 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:296 (iterator)
Found [Warning] `'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:134 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:207 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:537 (iterator)
Found [Warning] `'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:106 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:178 (iterator)
Found [Warning] `'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:56 (iterator)
Found [Warning] `'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:98 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:344 (iterator)
Found [Warning] `'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:63 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:366 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:439 (iterator)
Found [Warning] `'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:70 (iterator)
Found [Warning] `'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).` in peb.js:414 (iterator)

TheColdPot added a commit to TechPot-Studio/peb.js that referenced this issue Oct 7, 2020
@TheColdPot
Copy link
Author

In this case, can I put .jshintrc in the src/ directory?

TheColdPot added a commit to TechPot-Studio/peb.js that referenced this issue Oct 7, 2020
TheColdPot added a commit to TechPot-Studio/peb.js that referenced this issue Oct 7, 2020
@TheColdPot
Copy link
Author

TheColdPot commented Oct 7, 2020

Okay, so now this is resolved
But what if I want to put .jshintrc in the root directory?

@franciscodua
Copy link
Contributor

franciscodua commented Oct 7, 2020

Okay, so now this is resolved

Glad to hear it

But what if I want to put .jshintrc in the root directory?

I would say to evaluate your root directory (leave the directory value as default), instead of targeting the src directory. The tool is meant to target a repository's root and ignore files if you want to. And to ignore these files you can use the .codacy.yml configuration file (https://docs.codacy.com/repositories-configure/codacy-configuration-file/).

An example of .codacy.yml for your project could be

---
exclude_paths:
  - .github/**
  - docs/**
  - dist/**

This way you can have the .jshintrc in the root directory

@TheColdPot
Copy link
Author

TheColdPot commented Oct 7, 2020

This way you can have the .jshintrc in the root directory

Thank you so much for help!

If you think this problem can be completely resolved, you can Close the Issue, but if you want to keep it for a few days to avoid the same problem, keep it

@franciscodua
Copy link
Contributor

Thanks for bearing with us.
I'll close this and point similar problems to this thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-issue Issue tracked on JIRA
Projects
None yet
Development

No branches or pull requests

2 participants