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

Update README.md #2258

Merged
merged 1 commit into from
Jan 13, 2023
Merged

Update README.md #2258

merged 1 commit into from
Jan 13, 2023

Conversation

davidjeddy
Copy link
Contributor

@davidjeddy davidjeddy commented Jan 13, 2023

Replace PWD with correct pwd.

Incorrect:

$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:rw -v $(PWD):/tmp/lint:rw oxsecurity/megalinter:latest
PWD: command not found
Skipped setting git safe.directory DEFAULT_WORKSPACE:  ...
Setting git safe.directory default: /github/workspace ...
Setting git safe.directory to /tmp/lint ...
[MegaLinter init] ONE-SHOT RUN
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/megalinter/run.py", line 9, in <module>
    linter = megalinter.Megalinter({"cli": True})
  File "/megalinter/MegaLinter.py", line 56, in __init__
    self.workspace = self.get_workspace()
  File "/megalinter/MegaLinter.py", line 361, in get_workspace
    raise FileNotFoundError(
FileNotFoundError: [Context] Unable to find a workspace to lint 
DEFAULT_WORKSPACE: 
GITHUB_WORKSPACE:

Corrected

$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:rw -v $(pwd):/tmp/lint:rw oxsecurity/megalinter:latest
Skipped setting git safe.directory DEFAULT_WORKSPACE:  ...
Setting git safe.directory default: /github/workspace ...
Setting git safe.directory to /tmp/lint ...
[MegaLinter init] ONE-SHOT RUN
[config] Environment variables only (no config file found in /tmp/lint)
----------------------------------------------------------------------------------------------------
------------------------------------ MegaLinter, by OX Security ------------------------------------
----------------------------------------------------------------------------------------------------
 - Image Creation Date: 2023-01-07T10:05:11Z
 - Image Revision: 8fd433c
 - Image Version: v6
----------------------------------------------------------------------------------------------------
The MegaLinter documentation can be found at:
 - https://megalinter.io/latest
...

Fixes #

Fix reference to Linux built in fn().

Proposed Changes

  1. Replace incorrect Linux builtin fn() invocation with correct reference

Readiness Checklist

Author/Contributor

  • Add entry to the [CHANGELOG] - No functionality change, unneeded.
  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

Replace `PWD` with correct `pwd`. 

Incorrect:

```sh
$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:rw -v $(PWD):/tmp/lint:rw oxsecurity/megalinter:latest
PWD: command not found
Skipped setting git safe.directory DEFAULT_WORKSPACE:  ...
Setting git safe.directory default: /github/workspace ...
Setting git safe.directory to /tmp/lint ...
[MegaLinter init] ONE-SHOT RUN
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/megalinter/run.py", line 9, in <module>
    linter = megalinter.Megalinter({"cli": True})
  File "/megalinter/MegaLinter.py", line 56, in __init__
    self.workspace = self.get_workspace()
  File "/megalinter/MegaLinter.py", line 361, in get_workspace
    raise FileNotFoundError(
FileNotFoundError: [Context] Unable to find a workspace to lint 
DEFAULT_WORKSPACE: 
GITHUB_WORKSPACE:
```

Corrected
```sh
$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:rw -v $(pwd):/tmp/lint:rw oxsecurity/megalinter:latest
Skipped setting git safe.directory DEFAULT_WORKSPACE:  ...
Setting git safe.directory default: /github/workspace ...
Setting git safe.directory to /tmp/lint ...
[MegaLinter init] ONE-SHOT RUN
[config] Environment variables only (no config file found in /tmp/lint)
----------------------------------------------------------------------------------------------------
------------------------------------ MegaLinter, by OX Security ------------------------------------
----------------------------------------------------------------------------------------------------
 - Image Creation Date: 2023-01-07T10:05:11Z
 - Image Revision: 8fd433c
 - Image Version: v6
----------------------------------------------------------------------------------------------------
The MegaLinter documentation can be found at:
 - https://megalinter.io/latest
...
```
@davidjeddy davidjeddy requested a review from nvuillam as a code owner January 13, 2023 09:13
@codecov-commenter
Copy link

Codecov Report

Merging #2258 (d807ddd) into main (601b540) will increase coverage by 0.02%.
The diff coverage is n/a.

❗ Current head d807ddd differs from pull request most recent head 3d831fa. Consider uploading reports for the commit 3d831fa to get more accurate results

@@            Coverage Diff             @@
##             main    #2258      +/-   ##
==========================================
+ Coverage   82.98%   83.00%   +0.02%     
==========================================
  Files         171      171              
  Lines        4502     4502              
==========================================
+ Hits         3736     3737       +1     
+ Misses        766      765       -1     
Impacted Files Coverage Δ
megalinter/reporters/UpdatedSourcesReporter.py 89.74% <0.00%> (+2.56%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@nvuillam nvuillam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you for the PR :)

@nvuillam nvuillam merged commit 8d7d7f0 into oxsecurity:main Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants