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

appveyor で文字コードをチェックして UTF-8 になっていなかったら処理を失敗させる #478

Merged
merged 4 commits into from
Sep 24, 2018

Conversation

m-tmatma
Copy link
Member

#313: appveyor で文字コードをチェックして UTF-8 になっていなかったら処理を失敗させる

cpp/h ファイルの文字コードをチェックして、UTF-8 あるいは ascii で
なかったら appveyor ビルドを失敗させる

テスト的に shift-jiis で cpp ファイルを追加したもの
https://ci.appveyor.com/project/m-tmatma/sakura/build/1.0.645

参考
#313 (comment)

@beru
Copy link
Contributor

beru commented Sep 24, 2018

AppVeyor のログを見て思ったのですが、

---- start python checkEncoding.py ----
('SHIFT_JIS', u'test.cpp')
return 1
error checkEncoding.py

ファイル名にリポジトリルートからのフォルダも出力されるかどうかが気になります。

この test.cpp ファイルが無いか https://github.com/m-tmatma/sakura/commits/feature/issue313-check-encoding を漁ってみましたが見つかりませんでした。

@m-tmatma
Copy link
Member Author

この test.cpp ファイルが無いか https://github.com/m-tmatma/sakura/commits/feature/issue313-check-encoding を漁ってみましたが見つかりませんでした。

それを入れると、PR が失敗するので失敗することを確認した後、rebase して消しました。

Copy link
Contributor

@berryzplus berryzplus left a comment

Choose a reason for hiding this comment

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

これってどういうステータスですか?

試しに書いてみた or 入れる気でPR出した

変換対応が済んでないファイルがあるので、いまいれちゃマズい気がしています。

@m-tmatma
Copy link
Member Author

これってどういうステータスですか?

マージしても問題ない認識です。

変換対応が済んでないファイルがあるので、いまいれちゃマズい気がしています。

cpp/h ファイルに関しては変換が完了している認識です。

バッチファイル等に関しては対象外です。

@m-tmatma
Copy link
Member Author

なお、#313 (comment) のロジックを
使っていて、変更のあったファイルのみチェックすることで実行速度を稼いでいるのと
変更していないファイルをチェックしないようにすることで意図せず PR が失敗しないように
しています。

Copy link
Contributor

@beru beru left a comment

Choose a reason for hiding this comment

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

処理的には動いてそうなので問題無いと思います。

検出時のメッセージにフォルダ部分が出るか分かりませんが、仮にもし出なかったとしたら出したい人が手直しすればすればよいですね。

@beru beru merged commit c7e33bd into sakura-editor:master Sep 24, 2018
@m-tmatma
Copy link
Member Author

検出時のメッセージにフォルダ部分が出るか分かりませんが、仮にもし出なかったとしたら出したい人が手直しすればすればよいですね。

feature/issue313-check-encoding のブランチから分岐して、sakura_core\CGrepAgentSJIS.cpp を Shift-JIS で追加して、ビルドに失敗することを確認したものです。
https://ci.appveyor.com/project/m-tmatma/sakura/build/1.0.647/job/q35nnrh7hy5f6jqy

m-tmatma added a commit to m-tmatma/sakura that referenced this pull request Sep 24, 2018
@m-tmatma m-tmatma mentioned this pull request Sep 24, 2018
berryzplus added a commit that referenced this pull request Sep 24, 2018
@beru
Copy link
Contributor

beru commented Sep 24, 2018

feature/issue313-check-encoding のブランチから分岐して、sakura_core\CGrepAgentSJIS.cpp を Shift-JIS で追加して、ビルドに失敗することを確認したものです。
https://ci.appveyor.com/project/m-tmatma/sakura/build/1.0.647/job/q35nnrh7hy5f6jqy

フォルダパスもちゃんと出ていますね。確認ありがとうございます。

@m-tmatma m-tmatma deleted the feature/issue313-check-encoding branch September 25, 2018 05:21
@m-tmatma
Copy link
Member Author

https://github.com/sakura-editor/sakura/wikiPull request を送る際の文字コードに関して を追加しました。

@m-tmatma m-tmatma added this to the next release milestone Sep 25, 2018
@m-tmatma m-tmatma added the CI appveyor など CI 関連 【ChangeLog除外】 label Sep 25, 2018
HoppingTappy pushed a commit to HoppingTappy/sakura that referenced this pull request Jun 11, 2019
…heck-encoding

appveyor で文字コードをチェックして UTF-8 になっていなかったら処理を失敗させる
HoppingTappy pushed a commit to HoppingTappy/sakura that referenced this pull request Jun 11, 2019
HoppingTappy pushed a commit to HoppingTappy/sakura that referenced this pull request Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI appveyor など CI 関連 【ChangeLog除外】
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants