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

Uses editorconfig to maintain consistent coding styles #6627

Merged
merged 1 commit into from
Nov 16, 2015
Merged

Uses editorconfig to maintain consistent coding styles #6627

merged 1 commit into from
Nov 16, 2015

Conversation

ManasJayanth
Copy link
Contributor

Fix for #6626

@yurydelendik
Copy link
Contributor

My stats show more than 130 files shall be affected, you diff has only 42.

stripCommentHeaders was not modified too.

@timvandermeij
Copy link
Contributor

stripCommentHeaders from

pdf.js/make.js

Lines 606 to 615 in d8ddde2

function stripCommentHeaders(content, filename) {
// Strip out all the vim/license headers.
var notEndOfComment = '(?:[^*]|\\*(?!/))+';
var reg = new RegExp(
'\n/\\* -\\*- Mode' + notEndOfComment + '\\*/\\s*' +
'(?:/\\*' + notEndOfComment + '\\*/\\s*|//(?!#).*\n\\s*)+' +
'\'use strict\';', 'g');
content = content.replace(reg, '');
return content;
}
should also be removed, along with the calls to that function. As Yury mentioned, probably there are more files with the header, so use a search to find out which ones exactly.

@yurydelendik
Copy link
Contributor

stripCommentHeaders ... should also be removed

Actually not removed, but modified to fit new header format.

@timvandermeij
Copy link
Contributor

Right, that should be done. It seems that the files in /web are missing in this PR (example: https://github.com/mozilla/pdf.js/blob/master/web/annotations_layer_builder.js). They also have this header.

@ManasJayanth
Copy link
Contributor Author

@yurydelendik Was it 131 files? 4 of them are from build directory.

@yurydelendik
Copy link
Contributor

Was it 131 files

I think it was 132

examples/acroforms/forms.js
examples/helloworld/hello.js
examples/node/domparsermock.js
examples/node/domstubs.js
examples/node/getinfo.js
examples/node/pdf2svg.js
examples/svgviewer/viewer.js
extensions/chromium/contentscript.js
extensions/chromium/extension-router.js
extensions/chromium/feature-detect.js
extensions/chromium/options/options.js
extensions/chromium/pageAction/background.js
extensions/chromium/pdfHandler-v2.js
extensions/chromium/pdfHandler-vcros.js
extensions/chromium/pdfHandler.js
extensions/chromium/preserve-referer.js
extensions/chromium/restoretab.js
extensions/chromium/suppress-update.js
extensions/firefox/bootstrap.js
extensions/firefox/chrome/content.js
extensions/firefox/content/PdfJs-stub.jsm
extensions/firefox/content/PdfJs.jsm
extensions/firefox/content/PdfJsTelemetry-addon.jsm
extensions/firefox/content/PdfJsTelemetry.jsm
extensions/firefox/content/PdfStreamConverter.jsm
extensions/firefox/content/PdfjsChromeUtils.jsm
extensions/firefox/content/PdfjsContentUtils.jsm
extensions/firefox/content/pdfjschildbootstrap.js
extensions/firefox/tools/l10n.js
external/builder/builder.js
external/builder/test.js
external/crlfchecker/crlfchecker.js
external/crlfchecker/normtext.js
external/importL10n/locales.js
make.js
src/core/annotation.js
src/core/arithmetic_decoder.js
src/core/bidi.js
src/core/charsets.js
src/core/chunked_stream.js
src/core/cmap.js
src/core/colorspace.js
src/core/core.js
src/core/crypto.js
src/core/evaluator.js
src/core/font_renderer.js
src/core/fonts.js
src/core/function.js
src/core/glyphlist.js
src/core/image.js
src/core/jbig2.js
src/core/jpg.js
src/core/jpx.js
src/core/metrics.js
src/core/murmurhash3.js
src/core/network.js
src/core/obj.js
src/core/parser.js
src/core/pattern.js
src/core/pdf_manager.js
src/core/ps_parser.js
src/core/stream.js
src/core/worker.js
src/display/annotation_helper.js
src/display/api.js
src/display/canvas.js
src/display/font_loader.js
src/display/metadata.js
src/display/pattern_helper.js
src/display/svg.js
src/display/webgl.js
src/pdf.js
src/shared/cffStandardStrings.js
src/shared/fonts_utils.js
src/shared/util.js
src/worker_loader.js
test/downloadutils.js
test/driver.js
test/features/tests.js
test/features/worker-stub.js
test/font/fontutils.js
test/font/ttxdriver.js
test/test.js
test/testutils.js
test/unit/annotation_layer_spec.js
test/unit/api_spec.js
test/unit/cmap_spec.js
test/unit/crypto_spec.js
test/unit/evaluator_spec.js
test/unit/font_spec.js
test/unit/function_spec.js
test/unit/metadata_spec.js
test/unit/obj_spec.js
test/unit/parser_spec.js
test/unit/stream_spec.js
test/unit/testreporter.js
test/unit/ui_utils_spec.js
test/unit/util_spec.js
test/webbrowser.js
test/webserver.js
web/annotations_layer_builder.js
web/chromecom.js
web/compatibility.js
web/debugger.js
web/default_preferences.js
web/download_manager.js
web/firefoxcom.js
web/hand_tool.js
web/interfaces.js
web/mozPrintCallback_polyfill.js
web/overlay_manager.js
web/password_prompt.js
web/pdf_attachment_view.js
web/pdf_document_properties.js
web/pdf_find_bar.js
web/pdf_find_controller.js
web/pdf_history.js
web/pdf_link_service.js
web/pdf_outline_view.js
web/pdf_page_view.js
web/pdf_presentation_mode.js
web/pdf_rendering_queue.js
web/pdf_thumbnail_view.js
web/pdf_thumbnail_viewer.js
web/pdf_viewer.component.js
web/pdf_viewer.js
web/preferences.js
web/secondary_toolbar.js
web/text_layer_builder.js
web/ui_utils.js
web/view_history.js
web/viewer.js

@@ -1,5 +1,4 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* Copyright 2013 Mozilla Foundation
/* Copyright 2014 Mozilla Foundation
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 revert changes of the year of copyright? It's hard to get it right and out of scope of this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about this Reverting

@Snuffleupagus
Copy link
Collaborator

It appears that this PR is still missing most of the files in https://github.com/mozilla/pdf.js/tree/master/extensions/firefox/content/.

@@ -1,5 +1,4 @@
/**
* Copyright (c) 2011-2013 Fabien Cazenave, Mozilla.
/* Copyright 2014 Mozilla Foundation
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please revert this change; and also the rest of the changes of Copyright year in the rest of this patch.

@@ -607,7 +605,6 @@ function stripCommentHeaders(content, filename) {
// Strip out all the vim/license headers.
var notEndOfComment = '(?:[^*]|\\*(?!/))+';
var reg = new RegExp(
'\n/\\* -\\*- Mode' + notEndOfComment + '\\*/\\s*' +
Copy link
Contributor

Choose a reason for hiding this comment

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

add '\n' to the next line, we want to not affect very first comment

also can you fix the comment above -- it does not reflect the purpose of the code below

Removes the following as they unnecessary
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
@yurydelendik
Copy link
Contributor

Hmm, grab-to-pan.js header is gone from viewer.js. @Rob--W is it okay or you prefer to keep it? We probably just need move copyright into main file header.

@Rob--W
Copy link
Member

Rob--W commented Nov 16, 2015

@yurydelendik I don't mind either way.

@yurydelendik
Copy link
Contributor

Added comment about that at #3775 (maybe @prometheansacrifice can look into that later :)

Thank you for the patch.

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

Successfully merging this pull request may close these issues.

6 participants