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

Fix code style and add copyright. #18

Merged
merged 9 commits into from
Aug 23, 2021
Merged

Fix code style and add copyright. #18

merged 9 commits into from
Aug 23, 2021

Conversation

pkufool
Copy link
Collaborator

@pkufool pkufool commented Aug 22, 2021

@csukuangfj I disabled the E501 rule of flake8 for file egs/librispeech/ASR/conformer_ctc/conformer.py as it will cut the comments into annoying pieces, especially the example code.

@csukuangfj
Copy link
Collaborator

The following is how the CI checks the code style and format:

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip black flake8
- name: Run flake8
shell: bash
working-directory: ${{github.workspace}}
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --show-source --statistics
flake8 .
- name: Run black
shell: bash
working-directory: ${{github.workspace}}
run: |
black --check --diff .

Could you fix the black version to the one mentioned in

- repo: https://github.com/psf/black
rev: 21.6b0
hooks:
- id: black
args: [--line-length=80]

i.e.

python3 -m pip install --upgrade pip black==21.6b0  flake8 

https://github.com/k2-fsa/icefall/blob/master/contributing.md
says how to set up the dev environment so that you can check the style locally.

cnn_module_kernel (int): Kernel size of convolution module
normalize_before (bool): whether to use layer_norm before the first block.
vgg_frontend (bool): whether to use vgg frontend.
num_features (int): Number of input features
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you reformat this file by hand or using black?

I just ran black on this file and nothing is changed.

(I am using black==21.6b0)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reverted the reformatting of conformer.py. It seems some conflicts between black and flake8, so ignored the E203 checking for that line.
image

@pkufool pkufool changed the title Fix code style and add CopyRight. Fix code style and add copyright. Aug 23, 2021
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.

2 participants