Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow specifying color= in shellcheckrc (closes #2350)#2352

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
oliv3r wants to merge1 commit intokoalaman:master
base:master
Choose a base branch
Loading
fromoliv3r:dev/add_color_option

Conversation

@oliv3r
Copy link

To be able to set the color option in the config file (detection in GitLab CI fails for example) is useful when using template shellcheck containers for one. Secondly, storing config in the repo is also a thing :)

Sadly, I got a bit overconfident and got lost very quickly. I never seen haskell before so there's a learning curve required I suppose. I did make a start hopefully for whomever can pick it up :)

@koalaman
Copy link
Owner

It's not entirely straight forward because.shellcheckrc files are per-file while the formatter options are per invocation.

For example, you can do

echo "disable=SC2034 # Don't warn about unused variables" > lib/.shellcheckrcecho "disable=SC2016 # I know how to use single quotes" > bin/.shellcheckrc

and thenshellcheck */*.sh will apply the correct rules to the correct files.

Thecolor option currently does not support being applied to some files but not others, and if you were to extend this towiki-link-count I'm not sure what it would mean for one file to say 0 and another to say 5.

@oliv3r
Copy link
Author

Alternatively, making sure auto 'always' works is an option :p

but in seriousness, I do like having options stored in a per-repo level. I think it should just traverse in the tree though, right? so global, trumps user, trumps root, trumps folder setting. So if you have it in your local rc, but not anywhere in the repo; you get it.

I suppose one could argue on the directory vs root level; it could be that 'note, some settings, regardless where they are set, are applied to the repo as a whole, when asking shellcheck to auto-scan for files, if this is undesiresd invoke shellcheck on a 'per file' basis' and there, it should favor local settings over root settings?

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
@Alhadis
Copy link

IMHO, this really belongs in an environment variable (FORCE_COLOR=1 andNO_COLOR=1). It's easier to forcefully enable/disable colour support for a process this way, and users typically do so cognisant of where/how output is being rendered; e.g.,an Emacs buffer or pager likeless(1) will want consistent colouration behaviour regardless of a project's local configuration.

andrewimeson reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@oliv3r@koalaman@Alhadis

[8]ページ先頭

©2009-2025 Movatter.jp