-
-
Notifications
You must be signed in to change notification settings - Fork 583
chore(linters): Apply ruff linter semi-automatic linting fixes #863
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
Changes from 10 commits
25fe05a
55009e6
cd045dd
93898c9
3223cfd
18348d0
7275ada
b95c7ed
9206bca
ea52922
5dfea37
3132f17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -53,12 +53,13 @@ def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType: | |||||
| 'https://github.com/antonbabenko/pre-commit-terraform/issues/248' | ||||||
| '#issuecomment-1290829226', | ||||||
| category=UserWarning, | ||||||
| stacklevel=2, | ||||||
|
MaxymVlasov marked this conversation as resolved.
Outdated
|
||||||
| ) | ||||||
|
|
||||||
| dirs: list[str] = [] | ||||||
| for filename in cast_to(list[str], parsed_cli_args.filenames): | ||||||
| for filename in cast_to('list[str]', parsed_cli_args.filenames): | ||||||
| if os.path.realpath(filename) not in dirs and ( | ||||||
| filename.endswith('.tf') or filename.endswith('.tfvars') | ||||||
| filename.endswith(('.tf', '.tfvars')) | ||||||
| ): | ||||||
| dirs.append(os.path.dirname(filename)) | ||||||
|
|
||||||
|
|
@@ -68,14 +69,17 @@ def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType: | |||||
| try: | ||||||
| procArgs = [] | ||||||
| procArgs.append('terraform-docs') | ||||||
| if cast_to(bool, parsed_cli_args.sort): | ||||||
| if cast_to('bool', parsed_cli_args.sort): | ||||||
| procArgs.append('--sort-by-required') | ||||||
| procArgs.append('md') | ||||||
| procArgs.append('./{dir}'.format(dir=dir)) | ||||||
| procArgs.append('>') | ||||||
| procArgs.append( | ||||||
| './{dir}/{dest}'.format( | ||||||
| dir=dir, dest=cast_to(bool, parsed_cli_args.dest) | ||||||
| procArgs.extend( | ||||||
| ( | ||||||
| 'md', | ||||||
| f'./{dir}', | ||||||
| '>', | ||||||
| './{dir}/{dest}'.format( | ||||||
| dir=dir, | ||||||
| dest=cast_to('bool', parsed_cli_args.dest), | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix incorrect type casting There's a bug in this line. You're casting - dest=cast_to('bool', parsed_cli_args.dest),
+ dest=cast_to('str', parsed_cli_args.dest),📝 Committable suggestion
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we have this rectified please? I mean accepting coderabbit's code suggestion?
This comment was marked as off-topic.
Sorry, something went wrong.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This comment was marked as off-topic.
Sorry, something went wrong.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
FWIW, this is not really related to the linting violations that are being fixed in this PR. It might be better to do this separately. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your organization has reached its limit of developer seats under the Pro Plan. In order to use the Chat feature, you need to buy additional seats
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Let's do it one way or another. Coderabbit is crying and I also don't think the confusing expression is worth of keeping in code once we've found it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your organization has reached its limit of developer seats under the Pro Plan. In order to use the Chat feature, you need to buy additional seats |
||||||
| ), | ||||||
| ), | ||||||
| ) | ||||||
| subprocess.check_call(' '.join(procArgs), shell=True) | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.