Skip to content

Conversation

@rohan-goel
Copy link
Contributor

@rohan-goel rohan-goel commented Feb 18, 2021

Fixes

Fixes #317 by @obulat

Description

  • Changed indent form 4 to 2
  • Added prettier and stylelint packages
  • Added pre-commit support for both eslint and stylelint using vue-cli

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main or master).
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@rohan-goel rohan-goel requested a review from a team as a code owner February 18, 2021 06:23
@rohan-goel rohan-goel requested review from kgodey and removed request for a team February 18, 2021 06:23
Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

Wow, there are a lot of changes in this PR, thank you for your work ! :)
I have added some comments that need to be addressed inline.

package.json Outdated
"lint": "vue-cli-service lint",
"i18n:report": "vue-cli-service i18n:report -v --src src/**/*.vue --locales src/locales/**.json -o output.json",
"lint:js": "vue-cli-service lint",
"stylelint": "stylelint \"**/*.{vue,css}\"",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make stylelint only lint the content of 'src' folder? Otherwise it also tries to lint 'coverage', 'dist', or any other folders we might add later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's ignoreFiles: ['docs/css/*'] property in stylelint.config.js which will prevent stylelint to lint this folder. So in future we can add other folder here. But still I'll make stylelint only lint the content of 'src' folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also does this mean eslint is also linting dist/js/* or vue-cli-service will handle it and will lint-staged lint 'dist' while committing or not?

Copy link
Member

Choose a reason for hiding this comment

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

I @rohan-goel we don't want the /dist folder linted, only the src/ files we write. I think @obulat's original approach to specify src/ is still the best approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zackkrida I have add "lint": "vue-cli-service lint && npx stylelint ./src/**/*.{vue,css} --fix" command in package.json. This will only lint src folder.

@rohan-goel rohan-goel requested a review from obulat February 19, 2021 15:46
@Cronus1007
Copy link
Member

@rohan-goel Update your brach to resolve the conflicts and also take a git pull

@rohan-goel
Copy link
Contributor Author

rohan-goel commented Feb 20, 2021

@Cronus1007 I resolved merge conflicts but now I'm getting another test failed. Can you tell me what went wrong??

@Cronus1007
Copy link
Member

Cronus1007 commented Feb 20, 2021

@rohan-goel Have a look at these two ss . One is from the code of cc-chooser repo and one from yours. You mistakenly made few changes in the StepHeader.vue. Resolve these conflicts tests will be working fine.
Screenshot from 2021-02-20 16-25-29
Screenshot from 2021-02-20 16-25-37

@rohan-goel
Copy link
Contributor Author

Thanks for your help @Cronus1007 .

Copy link
Member

@Cronus1007 Cronus1007 left a comment

Choose a reason for hiding this comment

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

@rohan-goel Plzzz update your branch to resolve the merge conflicts.

# Conflicts:
#	src/components/AttributionDetailsStep.vue
#	src/components/LicenseDetailsCard.vue
#	src/components/LicenseText.vue
#	src/store/index.js
#	src/utils/license-utilities.js
#	tests/unit/specs/components/AttributionDetailsStep.spec.js
#	tests/unit/specs/components/LicenseText.spec.js
Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, @rohan-goel ! The code looks much cleaner now :)

@obulat obulat merged commit 48f3385 into creativecommons:master Feb 26, 2021
@rohan-goel
Copy link
Contributor Author

Thanks, @obulat !!

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.

Add pre-commit hooks

4 participants