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

maintain: const over let, consistency #5494

Open
wants to merge 6 commits into
base: master
from

Conversation

@kmdrGroch
Copy link

kmdrGroch commented Aug 1, 2019

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions.

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.
@kmdrGroch
Copy link
Author

kmdrGroch commented Aug 1, 2019

I have updated some files to be consistent and written in "perfect ES6 style".
You might also would like to add some linter or writing in typescript in the future, since right now you are starting to losing consistency in your files, use var or let where you don't need it. If you agree I can configure ESlint for you to match your style, or try rewriting code to typescript

@mshirlaw

This comment has been minimized.

Copy link

mshirlaw commented on lib/build.js in 281fc57 Oct 4, 2019

This is potentially reassigned three lines below isn't it?

@mshirlaw

This comment has been minimized.

Copy link

mshirlaw commented on lib/build.js in 281fc57 Oct 4, 2019

Previously this returned truthy only when path.ext(file) was .icon but now it returns true whenever the return value of path.extname(file) returns truthy.

Isn't this a behavioral change?

The comment implies it should only return icon files.

@mshirlaw

This comment has been minimized.

Copy link

mshirlaw commented on scripts/lint.py in 281fc57 Oct 4, 2019

Is there a reason why you would include python whitespace changes in a PR that is cleaning up const and let in JavaScript files? Seems dangerous to me

@mshirlaw

This comment has been minimized.

Copy link

mshirlaw commented on scripts/lint.py in 281fc57 Oct 4, 2019

Including function arguments on a new line is valid python and even enforced by many linters. Is this change required?

const ext = path.extname(file)
if (ext !== '.icon') { return false }
return true
return path.extname(file) === true

This comment has been minimized.

Copy link
@spirinvladimir

spirinvladimir Nov 21, 2019

Looks like misprint..

return path.extname(file) === '.icon'

// Touch original files by updating mtime.
const chromiumSrcDirLen = chromiumSrcDir.length
sourceFiles.forEach(chromiumSrcFile => {
var overriddenFile = path.join(config.srcDir, chromiumSrcFile.slice(chromiumSrcDirLen))
const overriddenFile = path.join(config.srcDir, chromiumSrcFile.slice(chromiumSrcDirLen))
if (!fs.existsSync(overriddenFile)) {
// Try to check that original file is in gen dir.
overriddenFile = path.join(config.outputDir, 'gen', chromiumSrcFile.slice(chromiumSrcDirLen))

This comment has been minimized.

Copy link
@spirinvladimir

spirinvladimir Nov 21, 2019

assign to const overriddenFile!

kmdrGroch added 3 commits Nov 21, 2019
@kmdrGroch
Copy link
Author

kmdrGroch commented Nov 21, 2019

adapted @mshirlaw and @spirinvladimir suggestions.
Yea, it was a typo with that icon.

Reverted changes in python - though there shouldn't be any difference in the file functionality. Especially in that indent change in the last line. But agree - JS files are JS files.

@@ -2,6 +2,7 @@ const config = require('../lib/config')
const util = require('../lib/util')
const {braveTopLevelPaths, ethereumRemoteClientPaths} = require('./l10nUtil')


This comment has been minimized.

Copy link
@petemill

petemill Dec 5, 2019

Member

Please remove this extra line 😄

kmdrGroch added 2 commits Dec 5, 2019
@kmdrGroch
Copy link
Author

kmdrGroch commented Dec 5, 2019

Applied @petemill's suggestion and merged master (please check out the second commit if I merged correctly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.